我正在研究Michael Hartl的 Ruby on Rails Tutorial,并且我添加了代码来显示用户的Gravatar图像.它在Firefox和Safari中运行良好,但在Chrome中则不行(图像不会显示). 风景: #app/views/users/show.html.erb% pr
风景:
#app/views/users/show.html.erb <% provide(:title, @user.name) %> <h1> <%= gravatar_for @user %> <%= @user.name %> </h1>
和帮手:
#app/helpers/users_helper.rb module UsersHelper # Returns the Gravatar (http://gravatar.com/) for the given user. def gravatar_for(user) gravatar_id = Digest::MD5::hexdigest(user.email.downcase) gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}" image_tag(gravatar_url, alt: user.name, class: "gravatar") end end
这有什么不对?
对我来说,我不得不将( http://localhost:3000/)添加到Ghostery的白名单网站来解决同样的问题.