#22 open
Elijah S

allowing plugins to override views and keeping plugins from being cached in development mode

Reported by Elijah S | June 22nd, 2008 @ 01:49 PM

I would like to use engines to provide a mechanism for my rails application to have mods. In this case, I want a plugin to be able to override a view file in the main application.

Also, it is nice, and sometimes necessary, to be able to turn off the default behavior of how rails loads plugins. Normally, plugins are loaded once. It is nice to change this if you are developing a plugin (so that you don't have to restart the server on each change) and it is necessary to change this if any main application classes are first loaded from your plugin (because in these cases, by default they will stick around but then get loaded somewhere else and rails will freak out).

This snippet provides two options that can be set in a plugin's init.rb:

self.override_views = true

self.load_once = false

(using rails 2.1 and engines 2.1)

If there is any interest from James, I can make this a real patch with tests.

Comments and changes to this ticket

  • James Adam

    James Adam October 24th, 2008 @ 02:10 AM

    • State changed from “new” to “open”
    • Tag set to caching, dependencies, feature, view

    Reloading plugins is definitely something I'd be interested in. I think it would be most useful to be able to enable/disable plugin reloading at the application level, rather than the plugin (adding something like

    @@@ruby config.reload_plugins = true

    
    
    to config/environments/development.rb
    
    However, I'm not sure if this belongs in engines. It feels like a patch for Rails itself. What do you think?
    

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The rails engines plugin itself

Shared Ticket Bins

People watching this ticket

Pages