Saturday, 24 August 2013

Rails - Query for has_many association

Rails - Query for has_many association

I have a User model that has_many tweets. In the User index action I want
to show all Users who have tweeted, but I also only want to show the
latest tweet for each User.
@user = User.where.....
Not getting anywhere with this.

No comments:

Post a Comment