diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-03-05 21:28:25 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-03-05 21:28:25 -0500 |
commit | f72b55ce938a14313091a92d84c4083c3ba4f2fd (patch) | |
tree | 19439a28eb3519e060fe63e045dc412dfb3aa71a /app | |
parent | 0d710239a765787f10de304edc438de2dfaa9824 (diff) |
move the separate migrations into the original generates
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/users_controller.rb | 2 | ||||
-rw-r--r-- | app/views/users/_form.html.erb | 8 | ||||
-rw-r--r-- | app/views/users/index.html.erb | 4 | ||||
-rw-r--r-- | app/views/users/index.json.jbuilder | 2 | ||||
-rw-r--r-- | app/views/users/show.html.erb | 10 | ||||
-rw-r--r-- | app/views/users/show.json.jbuilder | 2 |
6 files changed, 25 insertions, 3 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index b18efed..989ef76 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -69,6 +69,6 @@ class UsersController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def user_params - params.require(:user).permit(:name, :email, :user_name) + params.require(:user).permit(:name, :email, :user_name, :password_digest, :remember_token) end end diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index 4d28738..ad89f47 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -23,6 +23,14 @@ <%= f.label :user_name %><br> <%= f.text_field :user_name %> </div> + <div class="field"> + <%= f.label :password_digest %><br> + <%= f.text_field :password_digest %> + </div> + <div class="field"> + <%= f.label :remember_token %><br> + <%= f.text_field :remember_token %> + </div> <div class="actions"> <%= f.submit %> </div> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 3692112..c0d52a0 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -6,6 +6,8 @@ <th>Name</th> <th>Email</th> <th>User name</th> + <th>Password digest</th> + <th>Remember token</th> <th></th> <th></th> <th></th> @@ -18,6 +20,8 @@ <td><%= user.name %></td> <td><%= user.email %></td> <td><%= user.user_name %></td> + <td><%= user.password_digest %></td> + <td><%= user.remember_token %></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 42d8b72..cf21a4a 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, :email, :user_name + json.extract! user, :id, :name, :email, :user_name, :password_digest, :remember_token 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 9455a3c..a0fa94c 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -15,5 +15,15 @@ <%= @user.user_name %> </p> +<p> + <strong>Password digest:</strong> + <%= @user.password_digest %> +</p> + +<p> + <strong>Remember token:</strong> + <%= @user.remember_token %> +</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 4919af3..11b0784 100644 --- a/app/views/users/show.json.jbuilder +++ b/app/views/users/show.json.jbuilder @@ -1 +1 @@ -json.extract! @user, :id, :name, :email, :user_name, :created_at, :updated_at +json.extract! @user, :id, :name, :email, :user_name, :password_digest, :remember_token, :created_at, :updated_at |