Skip to content

Commit

Permalink
Merge pull request rails#2494 from grzuy/3-0-stable
Browse files Browse the repository at this point in the history
Porting changes on form_tag method signature to 3-0-stable
  • Loading branch information
spastorino committed Aug 11, 2011
2 parents 1f63606 + 11f6531 commit f45c372
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions actionpack/lib/action_view/helpers/form_tag_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ module FormTagHelper
# <%= form_tag('/posts', :remote => true) %>
# # => <form action="/posts" method="post" data-remote="true">
#
def form_tag(url_for_options = {}, options = {}, *parameters_for_url, &block)
html_options = html_options_for_form(url_for_options, options, *parameters_for_url)
def form_tag(url_for_options = {}, options = {}, &block)
html_options = html_options_for_form(url_for_options, options)
if block_given?
form_tag_in_block(html_options, &block)
else
Expand Down Expand Up @@ -529,12 +529,12 @@ def range_field_tag(name, value = nil, options = {})
end

private
def html_options_for_form(url_for_options, options, *parameters_for_url)
def html_options_for_form(url_for_options, options)
options.stringify_keys.tap do |html_options|
html_options["enctype"] = "multipart/form-data" if html_options.delete("multipart")
# The following URL is unescaped, this is just a hash of options, and it is the
# responsability of the caller to escape all the values.
html_options["action"] = url_for(url_for_options, *parameters_for_url)
html_options["action"] = url_for(url_for_options)
html_options["accept-charset"] = "UTF-8"
html_options["data-remote"] = true if html_options.delete("remote")
end
Expand Down

0 comments on commit f45c372

Please sign in to comment.