juniorRuby on Rails
What are Rails callbacks?
Updated May 24, 2026
Short answer
Callbacks are hooks triggered during model lifecycle.
Deep explanation
They run before/after create, update, or destroy actions.
Real-world example
Automatically downcasing emails before saving.
Common mistakes
- Overusing callbacks causing hidden logic.
Follow-up questions
- What are alternatives to callbacks?
- Why callbacks can be dangerous?