how to select all categories select name only , subcategories select name only, limit X items

2 views
Skip to first unread message

Mark Moore

unread,
Mar 23, 2011, 2:42:18 PM3/23/11
to rubyonra...@googlegroups.com
I have 3 models where 'Categories' have many 'Sub-Categories' and many
'Items' through 'Sub Categories'.
What is a standard Rails 3 way of showing latest few 'items' from each
'sub-categories' that belongs to 'categories'.
So in my view I'd have something like:
category: Music
sub-category: Classical
items: mozart, bach (sorted by created_at)
sub-category:Rock
......
Category: Film....

So I would want: all categories select name only , subcategories select
name only, limit X items

Thanks,
Mark

--
Posted via http://www.ruby-forum.com/.

Reply all
Reply to author
Forward
0 new messages