I am on development environment on localhost:3000
I followed railscasts episode on Gravatar. I am trying to set my custom avatar image that is located in assets/images.
The code I use is this:
def avatar_url(user)
gravatar_id = Digest::MD5.hexdigest(user.email.downcase)
default_url = "#{root_url}assets/AwesomeAvatar.png"
"http://gravatar.com/avatar/#{gravatar_id}.png?s=100&r=g&d=#{CGI.escape(default_url)}"
end
The avatar does not load. When I try to save the image there is an error: "Failed - No file".
I changed default_url to:
default_url = "http://localhost:3000/assets/AwesomeAvatar.png"
When I go to this url i see the avatar's image but I still get the same error and the avatar does not load up. I also tried setting d as:
d="http://localhost:3000/assets/AwesomeAvatar.png"
and d=#{CGI.escape("http://localhost:3000/assets/AwesomeAvatar.png")}
but no luck having the avatar load either.
Any clue whats wrong?
Thanks