Mar 10 2008
Expected things_controller.rb to define ThingsController
Well, I had fun with this rather obscure error today. The basics are simple, for some reason, app/controllers/things_controller.rb could not be loaded or did not supply the expected class ThingsController. One common cause of this is that the helper for this controller is mistakenly named in singular form instead of plural. In the case of app/controllers/things_controller.rb, make sure app/helpers/things_helper.rb is not named thing_helper.rb and that the module it is supplying is named ThingsHelper and not ThingHelper. It is ok if the helper does not exist at all. This error is sometimes even more difficult to debug in the case of a misnamed helper because it can appear to be intermittent. The problem will only occur when a method defined in the helper is called due to lazy instantiation.
I hope this helps someone. As always, comments are welcome.