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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top