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?

Était-ce utile?

La 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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top