0

I read over this page - https://en.gravatar.com/site/implement/images/ - and looked at other posts, but it's not working for me.

Here's the code I'm using:

def gravatar_for(user, options = { size: 50 })
    gravatar_id = Digest::MD5::hexdigest(user.email.downcase)
    options[:default] = image_tag("https://s3.amazonaws.com/bucketname/image/default_gravatar_70.png")
    size = options[:size]
    gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}?s=#{size}"
    image_tag(gravatar_url, alt: user.name)
  end

I want whatever is in the link below to be the default gravatar for all new users. https://s3.amazonaws.com/bucketname/image/default_gravatar_70.png

But I'm still get the classic gravatar default.

johbones
  • 199
  • 13

2 Answers2

0

I saw the documentation, default picture can pass a d= parameter to set it default instead using theirs.

<img src="http://www.gravatar.com/avatar/00000000000000000000000000000000?d=http%3A%2F%2Fexample.com%2Fimages%2Favatar.jpg" />
Nich
  • 1,112
  • 1
  • 14
  • 29
0

Is your image link behind any security? If I click the link you have there I get an access denied error. Default image gravatar will only work with publicly available images.

muttonlamb
  • 6,341
  • 3
  • 26
  • 35