Created
July 29, 2009 09:17
-
-
Save alvin2ye/157950 to your computer and use it in GitHub Desktop.
rails plugin templete
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
vendor/plugins/auto_complete/ | |
vendor/plugins/auto_complete/lib | |
vendor/plugins/auto_complete/lib/auto_complete_macros_helper.rb | |
vendor/plugins/auto_complete/lib/auto_complete.rb | |
vendor/plugins/auto_complete/init.rb | |
vendor/plugins/auto_complete/README | |
vendor/plugins/auto_complete/Rakefile | |
# vendor/plugins/auto_complete/lib/auto_complete_macros_helper.rb | |
module AutoCompleteMacrosHelper | |
def test1 | |
"xxxx" | |
end | |
end | |
# vendor/plugins/auto_complete/lib/auto_complete.rb | |
module AutoComplete | |
def self.included(base) | |
base.extend(ClassMethods) | |
end | |
module ClassMethods | |
def auto_complete_for | |
define_method("tmd") do | |
render :text => "ssss" | |
end | |
end | |
end | |
end | |
# vendor/plugins/auto_complete/init.rb | |
ActionController::Base.send :include, AutoComplete | |
ActionController::Base.helper AutoCompleteMacrosHelper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment