Action Callbacks
Action callbacks enable controllers to run shared pre- and postprocessing code for its actions. These callbacks can be used to do authentication, caching, or auditing before the intended action is performed.
before_action :require_authentication
Action Callback Chain Skipping
Declaring an action callback on a base class conveniently applies to its subclasses, but sometimes a subclass should skip some of the action callbacks it inherits from a superclass:
skip_before_action :authenticate
Action Callback conditions
before_action :authorize, only: [: edit, :delete]