Introduction
Before and after filters let you run code automatically before or after certain actions in your Rails controller. This helps keep your code clean and organized.
You want to check if a user is logged in before showing a page.
You need to load some data before running an action.
You want to log information after an action finishes.
You want to clean up or reset something after an action runs.