A lot of plugins I've seen just have you include a module into  
ApplicationControllet as part of the install. It's explicit and obvious.

The other way I've seen is monkey patching ActionController::Base. The  
logic behind this is that the plugin is modifying rails core, not your  
app's files (i.e. ApplicationController).

Martin

On Jun 4, 2009, at 1:52, Guyren G Howe <[email protected]> wrote:

>
> Continuing my "fun with Engines" adventure, I would like to move a
> bunch of logic from ApplicationController into a plugin.
>
> It appears that if I just put it in an init file, in which I do
>
>    ApplicationController.class_eval do
>
> doesn't work because that doesn't get reloaded in development mode.
> Turning on cache_classes appears to fix it, but is a royal pain to
> work with, as you can imagine.
>
> Is there a "proper" way to do what I'm trying to do here?
>
> >

--~--~---------~--~----~------------~-------~--~----~
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
-~----------~----~----~----~------~----~------~--~---

Reply via email to