Thursday, May 15, 2008

Don't use "flash" for a controller method name




In Rails, don't use "flash" for a controller action name

This one bit me in the ass today. I was getting some crazy weird errors:


/!\ FAILSAFE /!\ Thu May 15 11:26:01 -0700 2008
Status: 500 Internal Server Error
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.sweep


And it turned out the only problem was that I had created a "def flash" method in my controller. I was making a Flash player, so this is probably DHH's way of getting back at people who use Flash instead of AJAX. I'm on to you, DHH. ;)