Skip to content

Commit

Permalink
Use Gravatar global configuration settings. Useful if you need to for…
Browse files Browse the repository at this point in the history
…ce ssl mode.
  • Loading branch information
steveyken committed Dec 7, 2012
1 parent daed451 commit 5733b1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ def avatar_for(model, args = {})
image_tag(model.avatar.image.url(args[:size]), args)
else
args = Avatar.size_from_style!(args) # convert size format :large => '75x75'
args = { :gravatar => { :default => 'mm' } }.merge(args)
gravatar_image_tag(model.email, args)
end

Expand Down
7 changes: 7 additions & 0 deletions config/initializers/gravatar.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
GravatarImageTag.configure do |config|
config.default_image = :mm # Set this to use your own default gravatar image rather then serving up Gravatar's default image [ 'http://example.com/images/default_gravitar.jpg', :identicon, :monsterid, :wavatar, 404 ].
config.filetype = nil # Set this if you require a specific image file format ['gif', 'jpg' or 'png']. Gravatar's default is png
config.rating = nil # Set this if you change the rating of the images that will be returned ['G', 'PG', 'R', 'X']. Gravatar's default is G
config.size = nil # Set this to globally set the size of the gravatar image returned (1..512). Gravatar's default is 80
config.secure = false # Set this to true if you require secure images on your pages.
end

0 comments on commit 5733b1a

Please sign in to comment.