Question

To implement a gravatar for an instance of user is <%= gravatar_for @user %>.

What if I wanted to specify another user, an admin user, who would have a permanent gravatar in the views of all regular users. How would I go about implementing this?

Was it helpful?

Solution

You'd have to either pull the admin user out of the database and use gravatar_for(@admin_user) or just hardcode the gravatar URL into an image_tag.

Do the latter if you can get away with it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top