diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index a614607..8f537ef 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -4,4 +4,8 @@ def index @users = User.all end + def show + @user = User.find(params[:id]) + end + end \ No newline at end of file diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb new file mode 100644 index 0000000..d30a19c --- /dev/null +++ b/app/views/users/show.html.erb @@ -0,0 +1,16 @@ +

User Profile

+ + + + + + + + + + +
Name: + <%= @user.name %> +
Role: + <%= @user.role %> +
\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 149da05..16b9876 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,4 +2,5 @@ # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html root "users#index" + resources :users end