Ruby on Rails Wednesday, November 25, 2015

On 25 November 2015 at 16:46, fugee ohu <fugee279@gmail.com> wrote:
> I'm sorry, i meant to say in the side pane should be links to only the
> immediate children categories, not all descendants, just the next level

So in the side pane
@category.children.each do |category|
category.name (or whatever)
end

and if in the main pane you want the listings for all descendant children
@category.descendants.each do |category|
category.listings.each do |listing|
# show listing data
end
end

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsDSL7gGkBFAyb-MTDa6Soq9wUSKCO%2Bm-WpDWpeeTOFAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment