-
Notifications
You must be signed in to change notification settings - Fork 0
Chapter 10 #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Chapter 10 #11
Conversation
40ffc60 to
bc01499
Compare
app/controllers/users_controller.rb
Outdated
| before_action :correct_user, only: [:edit, :update] | ||
| before_action :admin_user, only: :destroy | ||
| def index | ||
| @users = User.paginate page: params[:page], per_page: 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cho 10 vào settings nhé
app/controllers/users_controller.rb
Outdated
| end | ||
|
|
||
| def edit | ||
| @user = User.find_by id: params[:id] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lawpj code rồi nhé
app/helpers/sessions_helper.rb
Outdated
| cookies.permanent[:remember_token] = user.remember_token | ||
| end | ||
|
|
||
| def current_user? user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vieets trong model nhé
app/views/users/_form.html.erb
Outdated
| @@ -0,0 +1,19 @@ | |||
| <%= form_for @user do |f| %> | |||
| <%= render "shared/error_messages", object: @user %> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent
1287be2 to
5a21f67
Compare
No description provided.