diff options
Diffstat (limited to 'app/views/users')
-rw-r--r-- | app/views/users/_form.html.erb | 12 | ||||
-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 | 15 | ||||
-rw-r--r-- | app/views/users/show.json.jbuilder | 2 |
5 files changed, 35 insertions, 2 deletions
diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index 4835056..a7ead1b 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -11,6 +11,18 @@ </div> <% end %> + <div class="field"> + <%= f.label :name %><br> + <%= f.text_area :name %> + </div> + <div class="field"> + <%= f.label :pw_hash %><br> + <%= f.text_field :pw_hash %> + </div> + <div class="field"> + <%= f.label :groups %><br> + <%= f.text_field :groups %> + </div> <div class="actions"> <%= f.submit %> </div> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 24a2548..14739ae 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -3,6 +3,9 @@ <table> <thead> <tr> + <th>Name</th> + <th>Pw hash</th> + <th>Groups</th> <th></th> <th></th> <th></th> @@ -12,6 +15,9 @@ <tbody> <% @users.each do |user| %> <tr> + <td><%= user.name %></td> + <td><%= user.pw_hash %></td> + <td><%= user.groups %></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 6684a9c..58c42c1 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 + json.extract! user, :id, :name, :pw_hash, :groups 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 32abeb0..05150f5 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,4 +1,19 @@ <p id="notice"><%= notice %></p> +<p> + <strong>Name:</strong> + <%= @user.name %> +</p> + +<p> + <strong>Pw hash:</strong> + <%= @user.pw_hash %> +</p> + +<p> + <strong>Groups:</strong> + <%= @user.groups %> +</p> + <%= link_to 'Edit', edit_user_path(@user) %> | <%= link_to 'Back', users_path %> diff --git a/app/views/users/show.json.jbuilder b/app/views/users/show.json.jbuilder index 80ed63e..968b383 100644 --- a/app/views/users/show.json.jbuilder +++ b/app/views/users/show.json.jbuilder @@ -1 +1 @@ -json.extract! @user, :id, :created_at, :updated_at +json.extract! @user, :id, :name, :pw_hash, :groups, :created_at, :updated_at |