Hello,
I have image categories, and each category has an image. In my
controller I’m using:
@image_categories = ImageCategory.find(:all, :include => :images)
and inside the view
<% @image_categories.each do | category | -%>
<%= category.name %>
<% category.images.each do | image | -%>
<%= image.name%>
<% end -%>
<% end -%>
The code works, however i want to limit the display to only one image
per category. So my question would be how can i combine :limit with the
:include sintax ?
Thanks… any help would be really apreciated