ruby-on-railsdevisebefore-filter

How to skip a before_filter for Devise's SessionsController?


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 ?


Solution

  • We did something like this:

    First up, create your own session controller, make sure to inherit correctly:

    class SessionsController < Devise::SessionsController
      skip_before_filter :foobar
    

    Then fix the routes

    devise_for :users,
      :controllers => {
        :sessions => "sessions"
      }
    

    Alternatively you could monkey-patch Devise's session controller.