Thank you very much! > > Now I want to list an entire product, with all its attributes, in a > > view, which is where I got stuck. I want these associations to show > > hierarchically, so that a child is in fact a child element ( for > > example a list item ) of its parent. I can get all attributes using > > the product_id, so I have defined a collection called @attributes in > > my controller. But how to proceed in the view? > > Use awesome_nested_set for this. It's much better for arbitrary tree > structures than the simple adjacency list that you're currently using.
I'll look into it. How would this look in my views? > > > My guess is that I need a partial which loads itself, but how to pass > > along the subcollection (a child -can- have another child which can > > have. another child and so on). > > With a nested-set model such as I am recommending, you can get all the > descendants with a single query. Without it...well...good luck. :) Got it ;) > > > It's important that it sorts every > > subcollection (e.g. a few children of a certain child) by position: do > > I have that covered in my model by :order => :position? > > Maybe. Or you could use acts_as_list. > Id did, as you can see in my model. Is this enough? > > > I really hope you can help. > > > Thank you! > > > Jaap Haagmans > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...@marnen.org > -- > Posted viahttp://www.ruby-forum.com/. Thanks again. --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---