Automating a redirect_to / flash cleanup ·
If you're like me and have an application with some pockets of very outdated Rails idioms, you may have code like this in your controllers: This can of course be rewritten to use a Hash as the second argument to redirect_to: And there's a similar, but slightly different, transformation that can be made for setting error flash messages: I had a bunch of these changes that needed fixing up, and it would have taken around 15 minutes to search around the codebase and fix all the references.