Created
September 22, 2012 06:59
-
-
Save sumitasok/3765405 to your computer and use it in GitHub Desktop.
Module included
This file contains 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
class UserDefined | |
module ActionController # :nodoc: all | |
def self.included(base) | |
base.send :helper_method, :user_method | |
end | |
private | |
def user_method | |
@user_defined ||= UserDefined.new( | |
:var => 'value', | |
:variable => 'variable' | |
) | |
end | |
end | |
end | |
ActionController::Base.send :include, UserDefined::ActionController |
This file contains 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
class UserDefined | |
# Add Rails helper if ActionController::Base is defined | |
require "folder/action_controller" if defined?(ActionController::Base) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment