Created
August 27, 2021 16:36
-
-
Save bondarolik/7789fb4b811e27a3f98c7d30ee10554b to your computer and use it in GitHub Desktop.
Devise for Application Controrller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
class ApplicationController < ActionController::Base | |
protect_from_forgery with: :exception | |
before_action :configure_permitted_parameters, if: :devise_controller? | |
before_action :authenticate_user! | |
def after_sign_in_path_for(resource) | |
root_path | |
end | |
protected | |
def configure_permitted_parameters | |
devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, :rut_number]) | |
devise_parameter_sanitizer.permit(:account_update, keys: [:first_name, :last_name, :rut_number, :role]) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment