我安装了Rails 2.3.3并且jrails_auto_complete插件似乎不起作用:
# View
text_field_with_auto_complete :photo, :place
# Controller
auto_complete_for :photo, :place
# Routes
map.auto_complete ':controller/:action',
:requirements => { :action => /auto_complete_for_\S+/ },
:conditions => { :method => :get }
这是请求的网址:
http://localhost:3000/photos/auto_complete_for_photo_place?photo%5Bplace%5D=Test
这是回应:
ArgumentError in PhotosController#auto_complete_for_photo_place wrong number of arguments (0 for 1) Trace: /Users/marco/Sites/foto-fiori/vendor/plugins/jrails_auto_complete/lib/jrails_auto_complete.rb:10:in `method' /Users/marco/Sites/foto-fiori/vendor/plugins/jrails_auto_complete/lib/jrails_auto_complete.rb:10:in `auto_complete_for_photo_place' /Users/marco/Sites/foto-fiori/vendor/rails/actionpack/lib/action_controller/base.rb:1327:in `send' ... Request Parameters: {"photo"=>{"place"=>"C"}, "locale"=>"it"}