Commit 057bc021
Changed files (4)
app
helpers
views
profiles
registrations
app/helpers/application_helper.rb
@@ -4,6 +4,12 @@ module ApplicationHelper
gravatar_id = Digest::MD5.hexdigest(user.email.downcase)
"http://gravatar.com/avatar/#{gravatar_id}.png?&d=#{CGI.escape(default_url)}"
end
+ def gravatar_for(user, options = { size: 50 })
+ gravatar_id = Digest::MD5::hexdigest(user.email.downcase)
+ size = options[:size]
+ gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}?s=#{size}"
+ image_tag(gravatar_url, alt: user.name, class: 'gravatar')
+ end
def full_title(title)
if( title.blank? )
"Welcome to CakeSide, a place for cake enthusiasts to share their proud creations!"
app/views/profiles/favorites.html.erb
@@ -17,7 +17,7 @@
<h3><%= current_user.name %></h3>
<p>member since: <%= current_user.created_at.to_s :foomat %></p>
<p>last signed in: <%= current_user.last_sign_in_at.to_s :foomat %></p>
- <a href="http://en.gravatar.com/" target="_blank">Change My Photo</a>
+ <a href="http://gravatar.com/emails" target="_blank">Change My Photo</a>
</div>
<div class="span9">
<h2>My Favorites</h2>
app/views/profiles/mine.html.erb
@@ -13,7 +13,7 @@
<li><a href="<%= url_for profile_path(current_user) %>"><img src="<%= avatar_url current_user %>&s=200" alt="<%= current_user.name %>" /></a></li>
</ul>
<h3><%= current_user.name %></h3>
- <a href="http://en.gravatar.com/" target="_blank">Change My Photo</a>
+ <a href="http://gravatar.com/emails" target="_blank">Change My Photo</a>
<p>member since: <%= current_user.created_at.to_s :foomat %></p>
<p>last signed in: <%= current_user.last_sign_in_at.to_s :foomat %></p>
<hr>
app/views/registrations/edit.html.erb
@@ -119,7 +119,7 @@
<ul class="thumbnails">
<li><a href="<%= url_for profile_path(current_user) %>"><img src="<%= avatar_url current_user %>&s=200" alt="<%= current_user.name %>" /></a></li>
</ul>
- <a href="http://en.gravatar.com/" target="_blank">Change My Photo</a>
+ <a href="http://gravatar.com/emails" target="_blank">Change My Photo</a>
<p>member since: <%= current_user.created_at.to_s :foomat %></p>
<p>last signed in: <%= current_user.last_sign_in_at.to_s :foomat %></p>