method
after_action
v4.1.8 -
Show latest stable
- Class:
AbstractController::Callbacks::ClassMethods
after_actionpublic
Append a callback after actions. See _insert_callbacks for parameter details. Aliased as after_filter.
1Note
Params of conditions
You can pass an proc for o callback with the conditions
after_action :initial_value, only: [:index, :show], unless: -> { @foo.nil? }
after_action :initial_value, only: [:index, :show], if: -> { @foo }