I''ve got the folowing models associated with each other
venture <--- component --> attribute --> service
''-->'' means ''belongs to'' in case someone
wonders ;)
The thing is i want to show in the ''show'' action for the
venture
components ordered by the service
like so
@venture.services.each do |service|
service.components.each do |component|
= component.name
= component.attribute.name
In the venture model I got how to have the attributes
Venture (part)
has_many :attributes_, :through=>:components, :source=>:attribute
has_many :components,:dependent=>:destroy
Component
belongs_to :attribute
So its easy but the problem is with getting the services the way i
want to
It''s important for me to be able to do it in a simple way so I tried
all sorts of combinations like
has_many :services, :through=>:attributes_
Any ideas on this one? Is it possible this way through has_many and
belongs?
cheers
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---