app/controllers/users_controller.rb
def user_params
    general_fields = %i[email user_name first_name last_name org]
    admin_fields = %i[email user_name first_name last_name org admin]
    fields = @user.admin? ? admin_fields : general_fields
    params.require(:user).permit(*fields)
  end
# Never trust parameters from the scary internet, only allow the white list through.
Never trust parameters from the scary internet, only allow the white list through.
Never trust parameters from the scary internet only allow the white list through .
def user_params
    general_fields = %i[email user_name first_name last_name org]
    admin_fields = %i[email user_name first_name last_name org admin]
    fields = @user.admin? ? admin_fields : general_fields
    params.require(:user).permit(*fields)
  end
def user_params general_fields = %i[ email user_name first_name last_name org ] admin_fields = %i[ email user_name first_name last_name org admin ] fields = @user . admin? ? admin_fields : general_fields params . require ( :user ) . permit ( * fields ) end
Never trust parameters from the scary internet, only allow the white list through.
Never trust parameters from the scary internet only allow the white list through .