[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
-
Mike Dvorkin August 17th, 2010 @ 09:04 PM
- Milestone set to 0.9.10 "Alekhine"
- State changed from new to resolved
- Milestone order changed from 64 to 0
Thanks for the details info! I've basically taken you commit and moved the code to lib/fat_free_crm/plugin_view.rb. I think it looks cleaner that way. Please let me know if it works with your setup (hope it does!)
http://github.com/michaeldv/fat_free_crm/commit/07c2ba8fdebdcee1fe7...
-
marianrian September 12th, 2022 @ 01:33 AM
Through the article, I see fall guysthat it takes courage, the will to live wordle online has set out difficulties and adversities for me to overcome and become stronger.
-
Janes Benth April 6th, 2023 @ 07:41 PM
Many thanks for the valuable information that you have brought. I really hope that in the future you will always provide everyone with the maximum number of wonderful content.
heardle
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.
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