Rails 0.9 introduced the poor-man''s namespacing system (modules). However I continously keep bumping into all sorts of errors, which make me think I may be the one at error here. The latest I''ve run into is that I''m unable to include helpers for controllers in modules. So I have app/controllers/foo/bar_controller.rb app/helpers/foo/bar_helper.rb app/views/foo/bar/action.rhtml test/functional/foo/bar.rb but the helper for BarController doesn''t get loaded. Nor does the helper() method support strings with a slash so I can''t do it that way either. Am I perhaps wrong in how I''m using these modules, or is it really that buggy? -- Marten Veldthuis
According to Marten Veldthuis:> but the helper for BarController doesn''t get loaded. Nor does the helper() > method support strings with a slash so I can''t do it that way either. Am I > perhaps wrong in how I''m using these modules, or is it really that buggy?After discussing a bit on it with David, the answer is that helpers are only available within views. If you want to same fonctionnality, just use plain modules. -- Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- roberto-0kjVc+YyuDZX+h8frlqCcVAUjnlXr6A1@public.gmane.org Darwin snuadh.freenix.org Kernel Version 7.7.0: Sun Nov 7 16:06:51 PST 2004
David Heinemeier Hansson
2005-Jan-20 10:51 UTC
Re: Poor man''s namespacing, bugs all around?
> Am I perhaps wrong in how I''m using these modules, or is it really > that buggy?It sounds like more work could be done on it. Thanks for signing up. Looking forward to your patch. -- David Heinemeier Hansson, http://www.basecamphq.com/ -- Web-based Project Management http://www.rubyonrails.org/ -- Web-application framework for Ruby http://macromates.com/ -- TextMate: Code and markup editor (OS X) http://www.loudthinking.com/ -- Broadcasting Brain