Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4595054
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:54:56+00:00 2026-05-21T22:54:56+00:00

To implement Gravatar in my Rails3 application, I’m using the gravatar_image_tag gem in a

  • 0

To implement Gravatar in my Rails3 application, I’m using the gravatar_image_tag gem in a helper, but I’m having issues when mixing 2 config options:

  1. If the user doesn’t have a gravatar attached to his email a default image is rendered; but I want it to reference an external file (e.g., http://www.iconfinder.com/ajax/download/png/?id=43350&s=128 instead of :identicon or others)
  2. I also want the image to be resized on the fly to, let’s say 50px.

Independently, both options work as expected, but when I put them together:

def gravatar_for(user, options = { :default => 'http://www.iconfinder.com/ajax/download/png/?id=43350&s=128', :size => 50 })
  gravatar_image_tag(user.email.downcase, :alt => user.full_name,
                                          :class => 'gravatar',
                                          :gravatar => options)
end

the size option is not applied, and the gravatar gets rendered in it’s full size (128px in this case).

What am I doing wrong, or how can I achieve this combination?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T22:54:57+00:00Added an answer on May 21, 2026 at 10:54 pm

    Gravatar will not resize your default image for you. I assume that it just 302s to the ulr gave as a default if it does not find an gravatar for the email you gave it. It looks like the ‘s’ parameter in the iconfinder url is for the size you are trying to grab but that icon does not have a size of 50px available only 128, 256, and 512

    Example:

    http://www.iconfinder.com/ajax/download/png/?id=43350&s=256
    

    If you wanted a 50px and 80px versions of the icon I would save it to your applications public/image directory as default_gravatar_50.png and default_gravatar_80.png respectively and change your method like so.

    end

    def gravatar_for(user, options = {})
      options = { :size => 50 }.merge(options)
      options[:default] = image_tag("default_gravatar_#{options[:size]}.png
      gravatar_image_tag(user.email.downcase,
                         :alt => user.full_name,
                         :class => 'gravatar',
                         :gravatar => options)
    end
    

    Or if you find an icon on icon finder that is the size(s) you like change the setting of the default option like so.

    options[:default] = "http://www.iconfinder.com/ajax/download/png/?id=43350&s=#{options[:size]}"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I implement very big script logic using jquery plugin at caret(http://code.google.com/p/jquery-at-caret/), but now when
To implement database access in my application I followed Lars Vogel tutorial , but
To implement database access in my application I followed Lars Vogel tutorial , but
To implement data access code in our application we need some framework to wrap
I'm about to implement a feature in our application that allows the user to
How do I implement a Copy menu item in a Windows application written in
Goal: implement unfold function using only two arguments. The arguments: the first argument is
To implement a server supporting clients using web sockets , do servers keep an
I am trying to implement struts2-jquery-grid. But I am stuck with the serialization issue.
I implement this interleave method in java but it doesn't work properly. Where is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.