diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-12-24 01:04:08 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-12-24 01:04:08 +0000 |
commit | ac963f06233d24f26570901a60edabed4792688d (patch) | |
tree | 546306c0bcd8fc447c2d9e97e9090166e888c68f | |
parent | 96536bebaefccabcbfb5ce9e689dd40c4fb4e294 (diff) | |
download | rails-ac963f06233d24f26570901a60edabed4792688d.tar.gz rails-ac963f06233d24f26570901a60edabed4792688d.tar.bz2 rails-ac963f06233d24f26570901a60edabed4792688d.zip |
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
-rw-r--r-- | actionpack/lib/action_view/helpers/java_script_macros_helper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/java_script_macros_helper.rb b/actionpack/lib/action_view/helpers/java_script_macros_helper.rb index a01f91d8f1..47ae26e54e 100644 --- a/actionpack/lib/action_view/helpers/java_script_macros_helper.rb +++ b/actionpack/lib/action_view/helpers/java_script_macros_helper.rb @@ -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 |