How to skip a before_filter for Devise's SessionsController?

前端 未结 7 1728
失恋的感觉
失恋的感觉 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:21

    Before my colleague showed me the way I posted in my other answer, I did this. I'm posting this in case you think it's simpler.

    class ApplicationController < ActionController::Base
      # ...
      before_filter :do_something
    
      def do_something
        unless params[:controller] == 'devise/sessions'
          # ...
        end
      end
    end
    
    0 讨论(0)
提交回复
热议问题