David North
2005-Jun-20 10:47 UTC
innapropriate automatic requiring of helpers with controller inheritance
I have built a site with 2 sets of controllers, site and admin. Site controllers inherit from SiteController, admin from Admin:BaseController (in a sub folder). Both SiteController and Admin:BaseController inherit from ApplicationController. What i''ve found by accident is that helper methods placed in admin/base_helper.rb are also available to controllers (their views) that inherit from SiteController and vis-versa. It looks like all helpers are available to all views. I''d like to have a clean inheritance in my helpers that matches that of my controllers so that some are shared by the whole site, some by the whol admin section, or some for a specific site/admin controller etc. Is this the correct behaviour in Rails or could it be a bug? How do other people organise and use their helpers in this type of situation? David North _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Jeremy Kemper
2005-Jun-20 15:36 UTC
Re: innapropriate automatic requiring of helpers with controller inheritance
On Jun 20, 2005, at 3:47 AM, David North wrote:> What i''ve found by accident is that helper methods placed in admin/ > base_helper.rb are also available to controllers (their views) that > inherit from SiteController and vis-versa. It looks like all > helpers are available to all views.Helper behavior now matches your expectation: http:// dev.rubyonrails.com/ticket/1394 Best, jeremy