diff options
-rw-r--r-- | app/controllers/users_controller.rb | 6 | ||||
-rw-r--r-- | app/views/users/index.html.erb | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 6436e4e..c14f67c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -15,9 +15,13 @@ class UsersController < ApplicationController end def show - @user = User.find(param[:id]) + @user = User.find(params[:id]) end + def index + @users = User.all + end + private def user_params diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 8b9056b..10f19f4 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -1,6 +1,6 @@ <h1>Listing users</h1> -<table> +<table class="table table-hover"> <thead> <tr> <th>Name</th> @@ -15,7 +15,7 @@ <% @users.each do |user| %> <tr> <td><%= user.name %></td> - <td><%= user.pw_hash %></td> + <td> ******* </td> <td><%= link_to 'Show', user %></td> <td><%= link_to 'Edit', edit_user_path(user) %></td> <td><%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %></td> |