Change error message for typo in helper's name

I've tried to make the error message more helpful, when helper name is misspelled. I created new type of error (MissingHelperModuleError) which is raised when expected constant is not loaded. I'd appreciate any feedback  about my solution.

Fixes #16468
Okay, let’s go with your original error subclass :grin:

> Den 23/10/2014 kl. 19.50 skrev Marcin Nieborak <notifications@github.com>:
> 
> In actionpack/lib/abstract_controller/helpers.rb:
> 
> > @@ -150,7 +150,11 @@ def modules_for_helpers(args)
> >              rescue LoadError => e
> >                raise AbstractController::Helpers::MissingHelperError.new(e, file_name)
> >              end
> > -            file_name.camelize.constantize
> > +            file_name.camelize.tap do |helper_name|
> > +              unless Object.const_defined?(helper_name)
> > +                raise NameError, "Couldn't find #{helper_name}, expected it to be defined in app/helpers/#{file_name}.rb"
> @kaspth <https://github.com/kaspth> Thank You for your suggestions. I updated the code and it works fine in tests.
> However when I ran it against real app I found that the NameError we raise is being caught here:
> https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/routing/route_set.rb#L60-L61 <https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/routing/route_set.rb#L60-L61>
> and the error view is not rendered for some reason.
> 
> —
> Reply to this email directly or view it on GitHub <https://github.com/rails/rails/pull/16802/files#r19294352>.
> 

--
Kasper