So now in my brands view I'm trying to show all of the items associated
with that brand.
The following returns all items:
<% for item in Item.find(:all) %>
<%= item.name %>
<% end %>
But obviously I only want the items for a particular brand, so I tried:
<% for item in Item.find(:all, :conditions => {:brand_id => @brand.id})
%>
<%= item.name %>
<% end %>
But I get an error
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---