On Miércoles, 9 de Septiembre de 2009 05:51:38 rvhi escribió:
> Hi,
>
> I have a model like this,
>
> class Member < ActiveRecord::Base
>   belongs_to :master, :class_name => 'Member', :foreign_key =>
> 'master_id'
>   has_many :slaves, :class_name => 'Member', :order => 'name
> ASC', :foreign_key => 'master_id'
> end
>
> If a member is a master, its master_id is nil. Otherwise, master_id
> points to its master.
>
> In ActiveScaffold, the listing of members shows a nested scaffold to
> its slave members. In the table, it shows the right count of slaves.
> However when click the like and invoke the nested form, it just shows
> the master again, not any slave.
>   active_scaffold :member do |config|
>     config.columns = [:name, :slaves]
>   end
>
> Any suggestion please?

You must setup the revese associations because active scaffold can't guess in 
that case:
  config.columns[:master].association.reverse = :slaves
  config.columns[:slaves].association.reverse = :master



>
> Thanks,
>
> 
-- 
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to