aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Fuchs <thomas@fesch.at>2006-08-07 11:08:32 +0000
committerThomas Fuchs <thomas@fesch.at>2006-08-07 11:08:32 +0000
commita3b045a73e729e44719713084462825ef98f8bc0 (patch)
tree7eec271ae48be9ca9009f9a2916f980685e3ca12
parent883c54a3173a39c3e0afaeb85c4b5537590201e8 (diff)
downloadrails-a3b045a73e729e44719713084462825ef98f8bc0.tar.gz
rails-a3b045a73e729e44719713084462825ef98f8bc0.tar.bz2
rails-a3b045a73e729e44719713084462825ef98f8bc0.zip
Add support for the param_name parameter to the auto_complete_field helper. Fixes #5026 [david.a.williams@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4713 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_view/helpers/java_script_macros_helper.rb1
-rw-r--r--actionpack/test/template/java_script_macros_helper_test.rb2
3 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index f88dbd9d2e..d8104951c7 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -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]
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 c256f2d88b..f7523b843f 100644
--- a/actionpack/lib/action_view/helpers/java_script_macros_helper.rb
+++ b/actionpack/lib/action_view/helpers/java_script_macros_helper.rb
@@ -140,6 +140,7 @@ module ActionView
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,
diff --git a/actionpack/test/template/java_script_macros_helper_test.rb b/actionpack/test/template/java_script_macros_helper_test.rb
index 9d3c3f8052..7d2d8eb68f 100644
--- a/actionpack/test/template/java_script_macros_helper_test.rb
+++ b/actionpack/test/template/java_script_macros_helper_test.rb
@@ -38,6 +38,8 @@ class JavaScriptMacrosHelperTest < Test::Unit::TestCase
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