From 9dac6b759f57d93247ba6e8b8d8c7b9d5638dc22 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 26 May 2007 00:32:52 +0000 Subject: auto_complete_field takes a :method option so you can GET or POST. Closes #8120. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6851 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/java_script_macros_helper.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'actionpack/lib/action_view/helpers') 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 0d9e87fba0..d346f0367c 100644 --- a/actionpack/lib/action_view/helpers/java_script_macros_helper.rb +++ b/actionpack/lib/action_view/helpers/java_script_macros_helper.rb @@ -139,6 +139,8 @@ module ActionView # :select:: Pick the class of the element from which the value for # insertion should be extracted. If this is not specified, # the entire element is used. + # :method:: Specifies the HTTP verb to use when the autocompletion + # request is made. Defaults to POST. def auto_complete_field(field_id, options = {}) function = "var #{field_id}_auto_completer = new Ajax.Autocompleter(" function << "'#{field_id}', " @@ -152,6 +154,7 @@ module ActionView 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] + js_options[:method] = "'#{options[:method].to_s}'" if options[:method] { :after_update_element => :afterUpdateElement, :on_show => :onShow, :on_hide => :onHide, :min_chars => :minChars }.each do |k,v| -- cgit v1.2.3