Re: Reloading controller plugins on each request

Nick
Mon, 12 Apr 2010 03:03:57 -0000

On Apr 11, 6:26 pm, Frederick Cheung
<frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> If you want something to be reloadable you should use
> require_dependency to load it. The main thing though is that a
> plugin''s init.rb is not re-run between requests, so the include
you do
> on ApplicationController is lost after the first request.
>
> Fred

Right. So how can one get a module included in a controller on
subsequent requests without explicitly putting an #include in the
controller?

To facilitate development (IE: not restart WEBrick between requests),
I have this at the moment:
    class DashboardsController < ApplicationController
      include ActsAsDashboard
      acts_as_dashboard

I''d like to figure out how to remove that #include . Any ideas?