songtianlun
9fac43f46d
- Implement user creation in UsersController - Add user registration form in new.html.erb - Create error messages partial for form validation - Add gravatar helper for user profile - Update routes to include resources for users - Introduce integration tests for signup validation This commit establishes the foundation for user registration, allowing users to sign up with their details and providing feedback on form errors. It enhances the user experience by integrating visual elements like gravatars and error messages.
8 lines
269 B
Ruby
8 lines
269 B
Ruby
module UsersHelper
|
|
def gravatar_for(user, size: 80)
|
|
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
|