Hi,
In my application I’m using gravatar_image_tag to retrieve user’s
avatar.
I would like to show a custom image(registered in my assets directory)
in
case that user do not have an gravatar account.
How could I do it?
thx
Bruno M.
Hi,
In my application I’m using gravatar_image_tag to retrieve user’s
avatar.
I would like to show a custom image(registered in my assets directory)
in
case that user do not have an gravatar account.
How could I do it?
thx
Bruno M.
read or watch Ryan B. RailsCasts episode #244:
Thx soldier,
I will take a look
its about 4 minutes in.
The gravatar_image_tag gem has a configuration point for setting your
own default image rather then using the Gravatar default.
You can do it inline like so:
gravatar_image_tag(‘[email protected]’, :gravatar => { :default =>
‘http://example.com/images/your.png’ })
Or you configure it globally in an initializer
GravatarImageTag.configure do |config|
config.default_image = ‘http://example.com/images/your.png’
end
Refer to the README for more information
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs