Permalink
Browse files

Added :select option for JavaScriptMacroHelper#auto_complete_field th…

…at 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
  • Loading branch information...
dhh committed Dec 24, 2005
1 parent 96536be commit ac963f06233d24f26570901a60edabed4792688d
Showing with 2 additions and 1 deletion.
  1. +2 −1 actionpack/lib/action_view/helpers/java_script_macros_helper.rb
@@ -118,8 +118,9 @@ def auto_complete_field(field_id, options = {})
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

0 comments on commit ac963f0

Please sign in to comment.