Skip to content

Instantly share code, notes, and snippets.

@jrochkind
Created June 20, 2012 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrochkind/2961820 to your computer and use it in GitHub Desktop.
Save jrochkind/2961820 to your computer and use it in GitHub Desktop.
# This file provided in engine
module MyEngine
module MainAppControllerMethods
def do_it
return params[:do_it]
end
end
end
# Local 'main app' should be instructed to simply add this manually to their
# own ApplicationController
require 'my_engine/main_app_controller_methods'
class ApplicationController < ActionController::Base
#....
include MyEngine::MainAppControllerMethods
# ....
end
# Now every controller in the host app has access to a #do_it method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment