I'm not quite sure what you're getting at here.
If you have a model named Post, you could easily find the record with ID of
10 by doing the following:
Post.find(10)
But if you truly do have an array of post instances, you can find the one
with ID of 10 using Enumerable.find:
array_name.find { |instance| instance.id == 10 }
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/3Fm8TqYh5VIJ.
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.