Module: ActionController::Filters::InstanceMethods

Defined in:
lib/action_controller/filters.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.append_features(base) ⇒ Object



285
286
287
288
289
290
291
# File 'lib/action_controller/filters.rb', line 285

def self.append_features(base)
  super
  base.class_eval {
    alias_method :perform_action_without_filters, :perform_action
    alias_method :perform_action, :perform_action_with_filters
  }
end

Instance Method Details

#after_actionObject

Calls all the defined after-filter filters, which are added by using “after_filter :method”. If any of the filters return false, no more filters will be executed.



307
308
309
# File 'lib/action_controller/filters.rb', line 307

def after_action #:doc:
  call_filters(self.class.after_filters)
end

#before_actionObject

Calls all the defined before-filter filters, which are added by using “before_filter :method”. If any of the filters return false, no more filters will be executed and the action is aborted.



301
302
303
# File 'lib/action_controller/filters.rb', line 301

def before_action #:doc:
  call_filters(self.class.before_filters)
end

#perform_action_with_filtersObject



293
294
295
296
297
# File 'lib/action_controller/filters.rb', line 293

def perform_action_with_filters
  return if before_action == false || performed?
  perform_action_without_filters
  after_action
end