Thank you again!

On 18 aug, 23:38, Marnen Laibow-Koser <rails-mailing-l...@andreas-
s.net> wrote:
> jhaagmans wrote:
>
> [...]
>
> >> 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?
>
> Any way you like.  awesome_nested_set only deals with the data structure
> and makes it easier to retrieve the records from the DB.  How you render
> them in the view once retrieved is up to you.

I'm asking this because I don't get it. I've looked at the readme at
GitHub and installed the plugin. I understand how to implement it into
my model (I already had the parent_id and now I've added lft and rgt),
I think I can limit my model to just the acts_as_nested_set and make
it belong to product, but how to load it up? Can I do
@product_attributes = ProductAttributes.find(:all, :conditions =>
{ :product_id => @product.id } and use this collection somehow (how?)
in my view? Or will I need the root element and descend from there?
The documentation is just way too limited for me to understand. And
how will the view part work? I need to actually have a root element
including a <li> tag for a child which can have an <ul> tag -only- if
it has children of its own. This way I can, later on, make certain
parts of the list sortable.

I hope someone can help me with this.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to