My app has Photos that belong to Users.
In a photo#show view I\'d like to show \"More from this user\", and show a next and previous photo from that user. I would be
You can pass some options into the where method:
For the next photo:
Photo.where(:user_id => current_user.id, :created_at > current_photo.created_at).order("created_at").first
Previous photo
Photo.where(:user_id => current_user.id, :created_at < current_photo.created_at).order("created_at").last
I may have the first/last mixed up.