From e2b0837fb869612170fe09afb507366ea1b6f9c8 Mon Sep 17 00:00:00 2001 From: edikle Date: Wed, 31 Jan 2018 15:41:01 +0800 Subject: [PATCH] add user index page --- app/controllers/users_controller.rb | 7 ++++++- app/views/users/index.html.erb | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 app/views/users/index.html.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 3e74dea..a614607 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,2 +1,7 @@ class UsersController < ApplicationController -end + + def index + @users = User.all + end + +end \ No newline at end of file diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb new file mode 100644 index 0000000..6a73110 --- /dev/null +++ b/app/views/users/index.html.erb @@ -0,0 +1,12 @@ +

User List

+ + + + + + <% @users.each do |user| %> + + + + <% end %> +
Name
<%= user.name %>
\ No newline at end of file