[Backgroundrb-devel] Loading Rails Helpers in 1.2.1

Ezra Zygmuntowicz ezmobius at gmail.com
Tue Jan 23 14:01:34 EST 2007


On Jan 23, 2007, at 5:48 AM, Erik Morton wrote:

> I'm having a problem where a worker cannot load a rails helper in
> rails 1.2.1
>
> 20070123-08:27:15 (4974) uninitialized constant
> FileImportWorker::CatalogsHelper - (NameError)
> 20070123-08:27:15 (4974) /Users/erik/Documents/projects/myproject/
> trunk/config/../vendor/rails/activerecord/lib/../../activesupport/lib/
> active_support/dependencies.rb:478:in `const_missing'
> 20070123-08:27:15 (4974) /Users/erik/Documents/projects/myproject/
> trunk/lib/workers/file_import_worker.rb:11
>
> The CatalogsHelper is in app/helpers/catalogs_helper.rb, however it
> looks like "someone" thinks that the helper is an inner helper of the
> Worker. Any thoughts?
>
> Erik


	How are you trying to include that helper in your worker class? You  
probably need to prefix it with ::

so instead of

include CatalogsHelper

try

include ::CatalogsHelper

Cheers-
-- Ezra Zygmuntowicz 
-- Lead Rails Evangelist
-- ez at engineyard.com
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)




More information about the Backgroundrb-devel mailing list