#218 ✓resolved
Nathan B

[PATCH] - Plugins can override app view templates

Reported by Nathan B | August 14th, 2010 @ 03:01 AM | in 0.9.10 "Alekhine"

Hello,

I have discovered that Rails Engines plugins are designed for a different purpose than I had assumed. A plugin is supposed to contain functionality for a Rails app, and then the developer can override files from the plugin to suit the base application.

I was assuming that plugins were meant to provide a way to extend or modify the base application, and this is not entirely true in all cases.

Using a plugin, I can add new models, controllers and views. I can also override or add methods to models and controllers using a class_eval. But I cannot override view templates. This is because plugins are designed so that the base application files take precedence.

Redmine (http://www.redmine.org/) developers have already found a solution by prepending plugin views to the beginning of the load path, thereby giving them priority over RAILS_ROOT/app/views.

I have added the 'prepend_engine_views' plugin from redmine to our fork: http://github.com/crossroads/fat_free_crm/commit/17060135e7cecb4897...

Hope it helps,
Nathan B

Comments and changes to this ticket

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 ยป

Ruby on Rails CRM platform for Web 2.0 and beyond

People watching this ticket

Pages