Skip to content

Instantly share code, notes, and snippets.

@edavis10
Created August 19, 2009 16:00
Show Gist options
  • Save edavis10/170425 to your computer and use it in GitHub Desktop.
Save edavis10/170425 to your computer and use it in GitHub Desktop.
# vendor/plugins/plugin_a/init.rb
Dispatcher.to_prepare do
require_dependency 'application' # for ApplicationController
ApplicationController.send(:include, PluginAPatch)
end
# vendor/plugins/plugin_a/app/helpers/plugin_a_helper.rb
module PluginAHelper
def a_new_method
"You've been patched!"
end
end
# 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