On Viernes, 3 de Septiembre de 2010 22:57:19 mikelb escribió: > I have three tables: > > Store > Id > Name > ServiceStore > Id > ServiceId > StoreId > Service > Id > Name > > How do I... set it up so that I can have two pages with grids on > them: /stores and /services, and they can each have nested columns > for each other?
If ServiceStore don't have more attributes is better to remove Id attribute and use has_and_belongs_to_many. In other case, add has_many :through associations > > I have done this: > > Store > has_many :service_stores > ServiceStore > belongs_to :store > Service > has_many :service_stores > > > The main issue that I have is: what do I put in the def to_label > for the ServiceStore? Right now I have: > service.to_label ... but I'm seeing that it needs to be > conditional. When I'm on the /stores page, the column's to_label > needs to list the services and when I'm on the /services page, the > column's to_label needs to reference the stores. > > > Thanks for your help! > M -- 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.
