How to skip a before_filter for Devise's SessionsController?

前端 未结 7 1773
失恋的感觉
失恋的感觉 2020-12-01 12:46

I have a before_filter in my ApplicationController; that is, for every controller in my project.

How can I skip_before_filter

7条回答
  •  悲哀的现实
    2020-12-01 13:19

    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
    

提交回复
热议问题