In my backoffice/users_controller.rb , I wrote a class to build the permitted parameters
class Backoffice::UsersController < ApplicationController
class UserParams
def build params
params.require(:user).permit(:email, :password, :password_confirmation )
end
end
but using it in the create method,
def create
@user = User.new(UserParams.build(params))
I get an error :
undefined method `build' for Backoffice::UsersController::UserParams:Class
I guess I am wrong somewhere as the class is defined in the Backoffice module... where I am wrong ?
thanks for help