skip after_filter in controller before_filter

Posted by Rafael Carício on Stack Overflow See other posts from Stack Overflow or by Rafael Carício
Published on 2013-06-27T10:16:31Z Indexed on 2013/06/27 10:21 UTC
Read the original article Hit count: 249

I'm using Intercom rails in my application and I would like to not include intercom script in a certain situation. So, I would like to skip the intercom after_filter when a value is set in the user session. I tried that, but it didn't worked:

class ApplicationController < ActionController::Base
  before_filter :verify_session

  def verify_session
    if skip_intercom?
      self.class.skip_after_filter :intercom_rails_auto_include
    end
  end
end

Any idea if it's possible?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby-on-rails-3