From d0545c2820d101a98b3c895cf6e3691145a62f3c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Mar 2014 21:48:54 -0500 Subject: use separate migrations to make things hidden, add user#groups:integer --- app/controllers/users_controller.rb | 2 +- app/views/users/_form.html.erb | 8 -------- app/views/users/index.html.erb | 4 ---- app/views/users/index.json.jbuilder | 2 +- app/views/users/show.html.erb | 10 ---------- app/views/users/show.json.jbuilder | 2 +- 6 files changed, 3 insertions(+), 25 deletions(-) (limited to 'app') diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 989ef76..b18efed 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, :password_digest, :remember_token) + params.require(:user).permit(:name, :email, :user_name) end end diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index ad89f47..4d28738 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -23,14 +23,6 @@ <%= f.label :user_name %>
<%= f.text_field :user_name %> -
- <%= f.label :password_digest %>
- <%= f.text_field :password_digest %> -
-
- <%= f.label :remember_token %>
- <%= f.text_field :remember_token %> -
<%= f.submit %>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index c0d52a0..3692112 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -6,8 +6,6 @@ Name Email User name - Password digest - Remember token @@ -20,8 +18,6 @@ <%= user.name %> <%= user.email %> <%= user.user_name %> - <%= user.password_digest %> - <%= user.remember_token %> <%= link_to 'Show', user %> <%= link_to 'Edit', edit_user_path(user) %> <%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %> diff --git a/app/views/users/index.json.jbuilder b/app/views/users/index.json.jbuilder index cf21a4a..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, :email, :user_name, :password_digest, :remember_token + 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 a0fa94c..9455a3c 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -15,15 +15,5 @@ <%= @user.user_name %>

-

- Password digest: - <%= @user.password_digest %> -

- -

- Remember token: - <%= @user.remember_token %> -

- <%= 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 11b0784..4919af3 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, :password_digest, :remember_token, :created_at, :updated_at +json.extract! @user, :id, :name, :email, :user_name, :created_at, :updated_at -- cgit v1.2.3-54-g00ecf