Permalink
Browse files

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...
1 parent 883c54a commit a3b045a73e729e44719713084462825ef98f8bc0 @madrobby madrobby committed Aug 7, 2006
@@ -1,5 +1,7 @@
*SVN*
+* Add support for the param_name parameter to the auto_complete_field helper. #5026 [david.a.williams@gmail.com]
+
* 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]
* Make Routing noisy when an anchor regexp is assigned to a segment. #5674 [francois.beausoleil@gmail.com]
@@ -140,6 +140,7 @@ def auto_complete_field(field_id, options = {})
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]
+ js_options[:paramName] = "'#{options[:param_name]}'" if options[:param_name]
js_options[:frequency] = "#{options[:frequency]}" if options[:frequency]
{ :after_update_element => :afterUpdateElement,
@@ -38,6 +38,8 @@ def test_auto_complete_field
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>),
auto_complete_field("some_input", :url => { :action => "autocomplete" },
:after_update_element => "function(element,value){alert('You have chosen: '+value)}");
+ 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>),
+ auto_complete_field("some_input", :url => { :action => "autocomplete" }, :param_name => 'huidriwusch');
end
def test_auto_complete_result

0 comments on commit a3b045a

Please sign in to comment.