Skip to content

Commit

Permalink
user list/form bootstrap markup update
Browse files Browse the repository at this point in the history
  • Loading branch information
amtuannguyen committed Jan 15, 2025
1 parent fa82cb2 commit c3e1a23
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
12 changes: 6 additions & 6 deletions app/views/users/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<%= simple_form_for @user do |f| %>
<%= f.input :name %>
<%= f.input :email %>
<%= f.input :username %>
<%= f.input :usertype, collection: User::USER_TYPES %>
<%= f.input :role, collection: User::ROLES %>
<%= f.input :name, input_html: {class: "form-control"} %>
<%= f.input :email, input_html: {class: "form-control"} %>
<%= f.input :username, input_html: {class: "form-control"} %>
<%= f.input :usertype, collection: User::USER_TYPES, input_html: {class: "form-select"} %>
<%= f.input :role, collection: User::ROLES, input_html: {class: "form-select"} %>

<%= f.button :submit %>
<%= f.button :submit, class: "btn btn-primary" %>
<% end %>
23 changes: 15 additions & 8 deletions app/views/users/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@
<% @users_grouped.each do |role, users| %>
<h4><%= role.humanize.capitalize rescue nil %></h4>

<table class="table">

<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Username</th>
<th>Usertype</th>
<th>Role</th>
<th scope="col">Name</th>
<th scope="col">Email</th>
<th scope="col">Username</th>
<th scope="col">Usertype</th>
<th scope="col">Role</th>
<th scope="col"></th>
</tr>
<% for user in users %>
</thead>
<tbody>
<% for user in users %>
<tr>
<td><%= user.name %></td>
<td><%= user.email %></td>
Expand All @@ -23,5 +28,7 @@
<td><%= link_to "Details", user %></td>
</tr>
<% end %>
</table>
</tbody>
</table>

<% end %>

0 comments on commit c3e1a23

Please sign in to comment.