I am trying to override the devise controller but my changes don't have any affects.
this is my sessions_controller.rb for example
class Users::SessionsController < Devise::SessionsController
# before_action :configure_sign_in_params, only: [:create]
# GET /resource/sign_in
def new
super
authorize! :new, @user
end
# POST /resource/sign_in
def create
super
authorize! :create, @user
end
# DELETE /resource/sign_out
# def destroy
# super
# end
# protected
# If you have extra params to permit, append them to the sanitizer.
# def configure_sign_in_params
# devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
# end
end
this should take the def new of the 'normal' sessions controller and add the 2nd line to it.
the link of the original session_controller on github
and this is my routes.rb
Rails.application.routes.draw do
resources :sessions
resources :corsin_lists
resources :fileuploads do
collection { post :import }
end
root 'documents#index'
resources :documents
resources :entries
resources :documents do
member do
get :entries
end
end
devise_for :users, :controllers => {:sessions => "users_sessions"}
end