songtianlun
cf76756f55
- Implement users index action in UsersController - Create view for displaying all users with gravatar - Update header to link to users index - Add styles for user list display This commit introduces a new feature that allows logged-in users to view a list of all registered users. It includes necessary controller actions, view templates, and styling to improve the user interface.
9 lines
309 B
Ruby
9 lines
309 B
Ruby
module UsersHelper
|
|
def gravatar_for(user, options = { size: 80 })
|
|
size = options[:size]
|
|
gravatar_id = Digest::MD5.hexdigest(user.email.downcase)
|
|
gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}?s=#{size}"
|
|
image_tag(gravatar_url, alt: user.name, class: "gravatar")
|
|
end
|
|
end
|