From b8c14b654255376d79fae55e139a968930be4569 Mon Sep 17 00:00:00 2001 From: Tomer Kimia Date: Mon, 3 Mar 2014 19:51:30 -0500 Subject: fixed users table --- app/controllers/users_controller.rb | 6 +++++- app/views/users/index.html.erb | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'app') 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 @@

Listing users

- +
@@ -15,7 +15,7 @@ <% @users.each do |user| %> - + -- cgit v1.2.3-2-g168b
Name
<%= user.name %><%= user.pw_hash %> ******* <%= link_to 'Show', user %> <%= link_to 'Edit', edit_user_path(user) %> <%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %>