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.
42 lines
1.5 KiB
Plaintext
42 lines
1.5 KiB
Plaintext
<header class="navbar navbar-fixed-top navbar-inverse">
|
|
<div class="container">
|
|
<%= link_to "sample app", root_url, id: "logo" %>
|
|
<nav>
|
|
<div class="navbar-header">
|
|
<button type="button" class="navbar-toggle collapsed"
|
|
data-toggle="collapse"
|
|
data-target="#bs-example-navbar-collapse-1"
|
|
aria-expanded="false">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
</div>
|
|
<ul class="nav navbar-nav navbar-right collapse navbar-collapse"
|
|
id="bs-example-navbar-collapse-1">
|
|
<li><%= link_to "Home", root_url %></li>
|
|
<li><%= link_to "Help", help_url %></li>
|
|
<% if logged_in? %>
|
|
<li><%= link_to "Users", '#' %></li>
|
|
<li class="dropdown">
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
|
Account <b class="caret"></b>
|
|
</a>
|
|
<ul class="dropdown-menu">
|
|
<li><%= link_to "Profile", current_user %></li>
|
|
<li><%= link_to "Settings", edit_user_path(current_user) %></li>
|
|
<li class="divider"></li>
|
|
<li>
|
|
<%= link_to "Log out", logout_path, data: { turbo_method: :delete } %>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<% else %>
|
|
<li><%= link_to "Log in", login_path %></li>
|
|
<% end %>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
|
|
</header> |