Skip to content
This repository
Browse code

Add support for the param_name parameter to the auto_complete_field h…

…elper. Fixes #5026 [david.a.williams@gmail.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4713 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit a3b045a73e729e44719713084462825ef98f8bc0 1 parent 883c54a
Thomas Fuchs madrobby authored
2  actionpack/CHANGELOG
... ... @@ -1,5 +1,7 @@
1 1 *SVN*
2 2
  3 +* Add support for the param_name parameter to the auto_complete_field helper. #5026 [david.a.williams@gmail.com]
  4 +
3 5 * Deprecation! @session and @flash will be removed after 1.2. Use the session and flash methods instead. You'll get printed warnings during tests and logged warnings in dev mode when you access either instance variable directly. [Jeremy Kemper]
4 6
5 7 * Make Routing noisy when an anchor regexp is assigned to a segment. #5674 [francois.beausoleil@gmail.com]
1  actionpack/lib/action_view/helpers/java_script_macros_helper.rb
@@ -140,6 +140,7 @@ def auto_complete_field(field_id, options = {})
140 140 js_options[:callback] = "function(element, value) { return #{options[:with]} }" if options[:with]
141 141 js_options[:indicator] = "'#{options[:indicator]}'" if options[:indicator]
142 142 js_options[:select] = "'#{options[:select]}'" if options[:select]
  143 + js_options[:paramName] = "'#{options[:param_name]}'" if options[:param_name]
143 144 js_options[:frequency] = "#{options[:frequency]}" if options[:frequency]
144 145
145 146 { :after_update_element => :afterUpdateElement,
2  actionpack/test/template/java_script_macros_helper_test.rb
@@ -38,6 +38,8 @@ def test_auto_complete_field
38 38 assert_dom_equal %(<script type=\"text/javascript\">\n//<![CDATA[\nvar some_input_auto_completer = new Ajax.Autocompleter('some_input', 'some_input_auto_complete', 'http://www.example.com/autocomplete', {afterUpdateElement:function(element,value){alert('You have chosen: '+value)}})\n//]]>\n</script>),
39 39 auto_complete_field("some_input", :url => { :action => "autocomplete" },
40 40 :after_update_element => "function(element,value){alert('You have chosen: '+value)}");
  41 + assert_dom_equal %(<script type=\"text/javascript\">\n//<![CDATA[\nvar some_input_auto_completer = new Ajax.Autocompleter('some_input', 'some_input_auto_complete', 'http://www.example.com/autocomplete', {paramName:'huidriwusch'})\n//]]>\n</script>),
  42 + auto_complete_field("some_input", :url => { :action => "autocomplete" }, :param_name => 'huidriwusch');
41 43 end
42 44
43 45 def test_auto_complete_result

0 comments on commit a3b045a

Please sign in to comment.
Something went wrong with that request. Please try again.