Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为用户实例实现 gravatar 是<%= gravatar_for @user %>.
<%= gravatar_for @user %>
如果我想指定另一个用户,一个管理员用户,他会在所有普通用户的视图中拥有一个永久的 gravatar。我将如何实施呢?
您必须将管理员用户从数据库中拉出并使用gravatar_for(@admin_user)或将 gravatar URL 硬编码为image_tag.
gravatar_for(@admin_user)
image_tag
如果你能摆脱它,就做后者。