Helpers are automatically loaded by controllers if they share the same
root name, i.e. the 'PublishController' will try and load the
'PublishHelper'... if you want to include other helpers, you need to
explicitly include them in your controller, probably using the
'helper' class method, i.e.

  class PublishHelper < ApplicationController
    helper :article
    # ..
  end

BTW, to call a 'class-level' method, you should be using
PublishHelper.getmenu(), rather than PublishHelper::getmenu()

- james

On 3/22/06, Christophe Christophe <[EMAIL PROTECTED]> wrote:
> Thank you for your help James, using your solution I solved my problem
> in a minute...
>
> Now, you said that I could use the same solution and put getMenu() in a
> helper.. It would be better because the script in the lib directory is
> only reloaded when webrick starts - So, I've tried with something in a
> helper (helper directory under my engine):
>
> module PublishHelper
>
>   def PublishHelper.getmenu()
>     # snip
>   end
>
> end
>
> But that doesn't work - In the app's layout , using
> PublishHelper::getmenu produces an error "uninitialized constant
> ArticleHelper"
>
> Is there something special to do to use helpers or each script in the
> engine's helper directory is automatically provided to the main
> application ?
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> engine-users mailing list
> [email protected]
> http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org
>


--
* J *
  ~
_______________________________________________
engine-users mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org

Reply via email to