diff options
Diffstat (limited to 'app/views/users')
-rw-r--r-- | app/views/users/_form.html.erb | 10 | ||||
-rw-r--r-- | app/views/users/index.html.erb | 6 | ||||
-rw-r--r-- | app/views/users/index.json.jbuilder | 2 | ||||
-rw-r--r-- | app/views/users/show.html.erb | 20 |
4 files changed, 30 insertions, 8 deletions
diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index 56d9f90..4d28738 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -13,11 +13,15 @@ <div class="field"> <%= f.label :name %><br> - <%= f.text_area :name %> + <%= f.text_field :name %> </div> <div class="field"> - <%= f.label :pw_hash %><br> - <%= f.text_area :pw_hash %> + <%= f.label :email %><br> + <%= f.text_field :email %> + </div> + <div class="field"> + <%= f.label :user_name %><br> + <%= f.text_field :user_name %> </div> <div class="actions"> <%= f.submit %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 8b9056b..3692112 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -4,7 +4,8 @@ <thead> <tr> <th>Name</th> - <th>Pw hash</th> + <th>Email</th> + <th>User name</th> <th></th> <th></th> <th></th> @@ -15,7 +16,8 @@ <% @users.each do |user| %> <tr> <td><%= user.name %></td> - <td><%= user.pw_hash %></td> + <td><%= user.email %></td> + <td><%= user.user_name %></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> diff --git a/app/views/users/index.json.jbuilder b/app/views/users/index.json.jbuilder index 182437e..42d8b72 100644 --- a/app/views/users/index.json.jbuilder +++ b/app/views/users/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@users) do |user| - json.extract! user, :id, :name, :pw_hash + json.extract! user, :id, :name, :email, :user_name json.url user_url(user, format: :json) end diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 43c12fe..9455a3c 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,3 +1,19 @@ -app/views/users/show.html.erb +<p id="notice"><%= notice %></p> -<%= @user.name %>, <%= @user.email %> +<p> + <strong>Name:</strong> + <%= @user.name %> +</p> + +<p> + <strong>Email:</strong> + <%= @user.email %> +</p> + +<p> + <strong>User name:</strong> + <%= @user.user_name %> +</p> + +<%= link_to 'Edit', edit_user_path(@user) %> | +<%= link_to 'Back', users_path %> |