1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Added :select option for JavaScriptMacroHelper#auto_complete_field that makes it easier to only use part of the auto-complete suggestion as the value for insertion [Thomas Fuchs]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3345 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-12-24 01:04:08 +00:00
parent 96536bebae
commit ac963f0623

View file

@ -118,8 +118,9 @@ module ActionView
js_options[:tokens] = array_or_string_for_javascript(options[:tokens]) if options[:tokens]
js_options[:callback] = "function(element, value) { return #{options[:with]} }" if options[:with]
js_options[:indicator] = "'#{options[:indicator]}'" if options[:indicator]
js_options[:select] = "'#{options[:select]}'" if options[:select]
{ :on_show => :onShow, :on_hide => :onHide, :min_chars => :min_chars, :select => :select }.each do |k,v|
{ :on_show => :onShow, :on_hide => :onHide, :min_chars => :min_chars }.each do |k,v|
js_options[v] = options[k] if options[k]
end