Permalink
Browse files

No need for an initializer

  • Loading branch information...
David Padilla
David Padilla committed Jul 14, 2010
1 parent 9e4a75f commit ef60d16b56d89172de4056d7032f2ddbcd70036e
Showing with 7 additions and 8 deletions.
  1. +1 −1 README.markdown
  2. +1 −1 Rakefile
  3. +5 −2 lib/autocomplete.rb
  4. +0 −2 lib/generators/autocomplete_generator.rb
  5. +0 −2 lib/generators/templates/autocomplete.rb
View
@@ -19,7 +19,7 @@ I'd recommend you understand what's happening with those 3 tools before attempti
Include the gem on your Gemfile
- gem 'rails3-jquery-autocomplete', '>= 0.0.2'
+ gem 'rails3-jquery-autocomplete', '>= 0.0.3', :require => 'autocomplete'
Install it
View
@@ -2,7 +2,7 @@ require 'rubygems'
require 'rake'
require 'echoe'
-Echoe.new('rails3-jquery-autocomplete', '0.0.2') do |p|
+Echoe.new('rails3-jquery-autocomplete', '0.0.3') do |p|
p.description = "Use jQuery's autocomplete plugin with Rails 3."
p.url = "http://github.com/crowdint/rails3-jquery-autocomplete"
p.author = "David Padilla"
View
@@ -1,5 +1,4 @@
-module AutoComplete
-
+module Autocomplete
def self.included(base)
base.extend(ClassMethods)
end
@@ -42,4 +41,8 @@ def autocomplete(object, method, options = {})
end
end
end
+end
+
+class ActionController::Base
+ include Autocomplete
end
@@ -4,8 +4,6 @@ class AutocompleteGenerator < Rails::Generators::Base
def install
# Copy the unobtrusive JS file
copy_file('autocomplete-rails.js', 'public/autocomplete-rails.js')
- # Rails initializer
- copy_file('autocomplete.rb', 'config/initializers/autocomplete.rb')
end
def self.source_root
@@ -1,2 +0,0 @@
-require 'autocomplete'
-ActionController::Base.send :include, AutoComplete

0 comments on commit ef60d16

Please sign in to comment.