How to skip a before_filter for Devise's SessionsController?

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

    new answer

    what about wrapping the before_filter in an unless block filtering by params[:controller]

    def some_before_action
      unless params[:controller] == "sessions_controller_for_devise_name"
          ... #=> do the stuff here
      end 
    end
    

    old answer

    just authorize which actions should use the before filter

    before_filter :action, :only => ...
    

    and authorize your others.

    found this here

提交回复
热议问题