Created
August 19, 2009 16:00
-
-
Save edavis10/170425 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vendor/plugins/plugin_a/init.rb | |
Dispatcher.to_prepare do | |
require_dependency 'application' # for ApplicationController | |
ApplicationController.send(:include, PluginAPatch) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vendor/plugins/plugin_a/app/helpers/plugin_a_helper.rb | |
module PluginAHelper | |
def a_new_method | |
"You've been patched!" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vendor/plugins/plugin_a/lib/plugin_a_patch.rb | |
module PluginAPatch | |
def self.included(base) | |
base.class_eval do | |
helper :plugin_a | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment