Project

General

Profile

Cannot Overwrite application_helper.rb

Added by Stephen Womack over 14 years ago

I seem to be stuck trying to take and make a custom plugin. I wanted to make it so that the calendar page only shows the porject title and not the issue# and other info. For example, current system shows "Issue # 33 Project title", and i am modifying the code to show just "Project Title". i know i can edit the file redmine/app/helper/application_helper.rb file and set it up so it does this, but i decided it would be best to make this a plugin. I created a plugin and add this two files pluginname/app/helper/application_helper.rb and pluginname/app/views/common/_calendar.rhtml.

What is odd is that if i make a change to /app/views/common/_calendar.rhtml i see the effect on redmine, but if i modify pluginname/app/helper/application_helper.rb it is still executing the code form the original file location redmine/app/helper/application_helper.rb. I dont understand why i cannot overwrite the file application_helper.rb. Can anyone let me know what this stupid newbie is doing wrong?

I have tried to google this and look through the forums with no answer in site.

P.S. i was not sure if i should post this in plugins or help, so i picked one. :)

Thanks in advance.


Replies (1)

RE: Cannot Overwrite application_helper.rb - Added by Felix Schäfer over 14 years ago

Views in a plugin will be picked over the core views because it's just a matter of which comes first in the search paths, application code (controllers and models mostly) are not and you need to monkey-patch them to add new stuff or change the behavior of existing stuff. See Plugin_Tutorial and Plugin_Internals for more info, google for rails engines (as redmine plugins are basically only rails engines), and you can head over to the IRC channel, edavis10 should be able to help if you really get stuck.

    (1-1/1)