Commit 26f9ddef by Đường Sỹ Hoàng

Final commit

parent 87f261ef
...@@ -2,13 +2,14 @@ class UsersController < ApplicationController ...@@ -2,13 +2,14 @@ class UsersController < ApplicationController
before_action :logged_in_user, only: [:index, :edit, :update, :destroy] before_action :logged_in_user, only: [:index, :edit, :update, :destroy]
before_action :correct_user, only: [:edit, :update] before_action :correct_user, only: [:edit, :update]
before_action :admin_user, only: :destroy before_action :admin_user, only: :destroy
def index def index
@users = User.where(activated: true).paginate(page: params[:page]) @users = User.where(activated: true).paginate(page: params[:page])
end end
def show def show
@user = User.find(params[:id]) @user = User.find(params[:id])
redirect_to root_url and return unless @user.activated
@microposts = @user.microposts.paginate(page: params[:page]) @microposts = @user.microposts.paginate(page: params[:page])
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment