rubocop cleaning

This commit is contained in:
Aaro Koivukangas
2023-08-10 11:45:40 +03:00
parent 47a476c71c
commit f0c49274be
4 changed files with 20 additions and 17 deletions
@@ -2,6 +2,7 @@ class ApplicationController < ActionController::Base
helper_method :current_user
def current_user
return nil if session[:user_id].nil?
User.find session[:user_id]
end
end
+10 -9
View File
@@ -1,5 +1,5 @@
class UsersController < ApplicationController
before_action :set_user, only: %i[ show edit update destroy ]
before_action :set_user, only: %i[show edit update destroy]
# GET /users or /users.json
def index
@@ -59,13 +59,14 @@ class UsersController < ApplicationController
end
private
# Use callbacks to share common setup or constraints between actions.
def set_user
@user = User.find(params[:id])
end
# Only allow a list of trusted parameters through.
def user_params
params.require(:user).permit(:username)
end
# Use callbacks to share common setup or constraints between actions.
def set_user
@user = User.find(params[:id])
end
# Only allow a list of trusted parameters through.
def user_params
params.require(:user).permit(:username)
end
end