Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip_before_filter doesn't work #23

Open
rivsc opened this issue Aug 13, 2013 · 1 comment
Open

skip_before_filter doesn't work #23

rivsc opened this issue Aug 13, 2013 · 1 comment

Comments

@rivsc
Copy link

rivsc commented Aug 13, 2013

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

@rickpr
Copy link

rickpr commented Sep 7, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants