songtianlun
978c44b682
- Implemented edit and update actions in UsersController - Created edit user view and form partial - Updated user model validation to allow nil password - Modified header to link to user settings - Added integration tests for successful and unsuccessful edits This commit introduces the ability for users to edit their profile information, including name and email. It also includes validation updates to allow users to update their profiles without changing their password. Integration tests ensure that both successful and unsuccessful edit attempts are handled correctly.
19 lines
560 B
Plaintext
19 lines
560 B
Plaintext
|
|
<%= form_with(model: @user, local: true) do |f| %>
|
|
<%= render 'shared/error_messages' %>
|
|
|
|
<%= f.label :name %>
|
|
<%= f.text_field :name, class: 'form-control' %>
|
|
|
|
<%= f.label :email %>
|
|
<%= f.email_field :email, class: 'form-control' %>
|
|
|
|
<%= f.label :password %>
|
|
<%= f.password_field :password, class: 'form-control' %>
|
|
|
|
<%= f.label :password_confirmation, "Confirmation" %>
|
|
<%= f.password_field :password_confirmation, class: 'form-control' %>
|
|
|
|
<%= f.submit yield(:button_text), class: "btn btn-primary" %>
|
|
<% end %>
|