aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/form_tag_helper.rb4
-rw-r--r--actionpack/lib/action_view/helpers/prototype_helper.rb4
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb2
3 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb
index 0db1977051..816f1064f7 100644
--- a/actionpack/lib/action_view/helpers/form_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -20,8 +20,8 @@ module ActionView
def form_tag(url_for_options = {}, options = {}, *parameters_for_url, &proc)
html_options = options.stringify_keys
html_options["enctype"] = "multipart/form-data" if html_options.delete("multipart")
- html_options["action"] = url_for(url_for_options, *parameters_for_url)
-
+ html_options["action"] = url_for(url_for_options, *parameters_for_url)
+
method_tag = ""
case method = html_options.delete("method")
diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb
index 3c4c0ba98d..bf32dd9f49 100644
--- a/actionpack/lib/action_view/helpers/prototype_helper.rb
+++ b/actionpack/lib/action_view/helpers/prototype_helper.rb
@@ -164,10 +164,8 @@ module ActionView
options[:html] ||= {}
options[:html][:onsubmit] = "#{remote_function(options)}; return false;"
- options[:html][:action] = options[:html][:action] || url_for(options[:url])
- options[:html][:method] = options[:html][:method] || "post"
- tag("form", options[:html], true)
+ form_tag(options[:html].delete(:action) || url_for(options[:url]), options[:html])
end
# Works like form_remote_tag, but uses form_for semantics.
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index df728fd655..77f217b2d4 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -24,6 +24,7 @@ module ActionView
else
escape = true
end
+
url = @controller.send(:url_for, options, *parameters_for_method_reference)
escape ? html_escape(url) : url
end
@@ -57,6 +58,7 @@ module ActionView
else
tag_options = nil
end
+
url = options.is_a?(String) ? options : self.url_for(options, *parameters_for_method_reference)
"<a href=\"#{url}\"#{tag_options}>#{name || url}</a>"
end