Skip to content

Instantly share code, notes, and snippets.

@bondarolik
Created August 27, 2021 16:36
Show Gist options
  • Save bondarolik/7789fb4b811e27a3f98c7d30ee10554b to your computer and use it in GitHub Desktop.
Save bondarolik/7789fb4b811e27a3f98c7d30ee10554b to your computer and use it in GitHub Desktop.
Devise for Application Controrller
# 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