On Oct 13, 8:15 pm, Paul Young <[EMAIL PROTECTED]>
wrote:
> So I'm using:
>
find :last only exist in rails 2.1
> <% for item in Item.find(:all, :conditions => {:brand_id => brand.id},
> :limit => "1") %>
that doesn't return the last item, it shows the first one (however
without an order specified that is not always well defined).
brand.items.find :first is the same as the above, you can add an order
clause to get the last item.
Fred
> <%= item.name %>
> <% end %>
> --
> Posted viahttp://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
-~----------~----~----~----~------~----~------~--~---