I have a before_filter
in my ApplicationController
; that is, for every controller in my project.
How can I skip_before_filter
for Devise's SessionsController
create action ?
Here's a method my colleague just showed me:
# In config/application.rb
module YourAppNameHere
class Application < Rails::Application
# Whatever else is already here...
# The part to add
config.to_prepare do
Devise::SessionsController.skip_before_filter :your_before_filter_here
end
end
end
I recently had this problem with filter in my application_controller
I solved it using skip_before_filter
skip_before_filter :check_subdomain!, if: :devise_controller?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With