Following the railscast tutorial to add an image of the site I found an information lagged with rails updates. The code to create a default image in the case of absence of registration in the gravatar site does not work as in the code below suggests. I've 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
Here is the View code that calls the image:
<%= image_tag avatar_url(f) %>
Follow the link in the broken image that looks like this: