I am working on a Michael Hartl Rails tutorial and am having a weird problem adding a Gravatar section. I checked the code against another implementation of Gravatar in Rails, which I did for another tutorial, and I donβt see what is different.
Basically: the image does not appear, but if you right-click on the space and go to the URL that it will direct to the correct Gravatar page.
Code: (show.html.erb)
<%= gravatar_for @user %>
Code: (users_helper.rb)
def gravatar_for(user, options = { size: 50 }) size = options[:size] gravatar_id = Digest::MD5::hexdigest(user.email.downcase) gravatar_url = "https://secure.gravatar.com/avatars/#{gravatar_id}.png?s=#{size}" image_tag(gravatar_url, alt: user.name, class: "gravatar") end
Completely dead end, I know, probably, something really obvious that I went missing, but from the book and the Gravatar website I seem to be right about this ...
source share