I released Avatar version 0.0.3 today. This gem offers avatar support for a variety of sources. It's not Rails-specific, but to use it in a Rails app, do something like the following.
In app/helpers/people_helper.rb:
class PeopleHelper
include Avatar::View::ActionViewSupport
def default_avatar_url(size)
req = controller.request
"#{req.protocol}#{req.host_with_port}#{image_path("/images/avatar_default_#{size}.png")}"
end
end
app/views/people/show.html.erb:
<%= avatar_tag(@current_user, :size => 40, :default => default_avatar_url(:small) %>
The default settings will check for a Gravatar for @current_user.email
. There are other implementations, including one that works with the file_column plugin. I'll be happy to add more implementations; the project is hosted on GitHub.
3 comments:
I really enjoy reading the post, thanks for sharing I really like it, I already bookmarked it, thank you guys.
I'll be visiting your site again to gather some more valuable information. You truly did a good job.
I Like your blog,will sharing this with my friends, excellent work.
business voip systems
Post a Comment