Created
April 5, 2016 06:57
-
-
Save rahuldstiwari/b01c229165d50335bba3ea8adc384c8f to your computer and use it in GitHub Desktop.
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
rails create module | |
create a file in lib/foo.rb and put | |
module Foo | |
def self.hello | |
puts "ohohohohhhohohohoh" | |
end | |
end | |
-----include in controller----- | |
include Foo | |
------call module function in controller's action----- | |
Foo::hello |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment