rubycas/rubycas-client-rails

skip_before_filter doesn't work

Opened this issue · 1 comments

Hi,

class ApplicationController < ActionController::Base
  before_filter RubyCAS::Filter
end

class MyController < ApplicationController
skip_before_filter RubyCAS::Filter

def index
# But here before_filter is triggered !
end
end

How to do that ?

Regards,
Rivsc

If you'd like to use skip_before_filter, put RubyCAS::Filter in a method in ApplicationController. When you say skip_before_filter, Rails doesn't know what you're talking about if you don't. Here's an example:

class ApplicationController < ActionController::Base
  before_filter :cas_filter

  def cas_filter
    RubyCAS::Filter.filter(self)
  end

end

Then, in your other controller you may skip normally:

class MyController < ApplicationController
  skip_before_filter :cas_filter

  def index
    # No more CAS here
  end
end