I have a gallery model with image and user id. On the gallery index i would like to show the image with the user name. How do I retrieve username with the user id in the gallery model?
my relationships are
user has_many galleries
gallery belongs_to user
I am getting the user id through a hidden field which captures current user.
You can use gallery’s
userattribute :