Feature idea: remove internal <div> from form_for, form_tag and button_to

Hello Rails team, and thanks for your amazing work!

I would like to create a Pull Request so that form helpers do not add an extra

inside the tag.

I looked back in the history of the code, and I found that the

was initially added after this discussion of 2006 to make forms [x]HTML4 Strict-compliant.

Another message from 2007 confirmed the reason why behind the


Now it’s 2014, and HTML 5 finally allows elements to include elements directly, without a wrapping div.

What is your opinion? Should I go on and submit a pull request?

Also… how concerned are you about backward compatibility?
If you think it’s appropriate, I could add a new boolean option to “form_for”, “button_to”… so people can decide if they want the

or not.


I believe this has been added to Rails 4.2/master already: https://github.com/rails/rails/commit/89ff1f82f01bd70e12ec1b45049be30ac262df30


Carlos Antonio, you are right!

I didn’t realize that because the documentation of the method still includes the old format (with the wrapping


I created a PR to update the documentation accordingly: http://github.com/rails/rails/pull/17001


Great, thank you.