diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e025df3..99e98a6 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -10,7 +10,7 @@ def show end def edit - return unless current_user != User.find(params[:id]) + return unless current_user.id != params[:id].to_i redirect_to user_path(current_user), flash: { danger: '自分以外のプロフィールは編集できません。' } nil