1
Following the tutorial of railscast to add an image of the site Ravatar I found a lagged information with the updates of Rails. The code to create a default image in case of absence of registration on the Ravatar site does not work as in the code below suggests. I tried to exchange "images" for "Assets", does anyone have any idea that can solve the problem? follow the code:
module ApplicationHelper
def avatar_url(user)
default_url = "#{root_url}assets/default.jpg"
gravatar_id = Digest::MD5::hexdigest(user.email).downcase
"http://gravatar.com/avatar/#{gravatar_id}.png?s=48&d=#{CGI.escape(default_url)}"
end
end
Follow the View code that calls the image:
<%= image_tag avatar_url(f) %>
Follow the link of the broken image that looks like it:
Thank you Sergio!
– ygorbr