Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

form_tag is missing closing tag when no block is given #7894

Closed
betesh opened this Issue · 1 comment

2 participants

@betesh
form_tag ""

with no block, should result in:

<form accept-charset="UTF-8" action="" method="post"></form>

but instead results in:

<form accept-charset="UTF-8" action="" method="post">

This can cause come serious browser-rendering issues: if another opening form tag shows up later on the page, many browsers will ignore it.

In action_view/helper/form_tag_helper.rb, in form_tag function:

else
  form_tag_html(html_options)
end

should be:

else
  form_tag_html(html_options).safe_concat("</form>")
end
@rafaelfranca

This is documented behavior and I think it make sense. Closing this to move the discussion to #7901

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.