Why does this add <div style="margin:0;padding:0">?

Hi,

I have the following form_for tag that seems to be outputing any suggestions on how this can be stopped?

<% form_for :user, :url => user_path(@user), :html => {:method => :put}
do |f| %>

cheers
jon

Perhaps it adds the div due to compatibility with XHTML? I’m new here,
and quite new to Ruby on Rails too, but it seems fairly reasonable that
that’s what RoR is doing.

One must put a blocking object inside a form for it to be valid XHTML.

Valid:

Invalid:

I have no clue how to remove the div-element though, sorry.

torh wrote:

Perhaps it adds the div due to compatibility with XHTML? I’m new here,
and quite new to Ruby on Rails too, but it seems fairly reasonable that
that’s what RoR is doing.

One must put a blocking object inside a form for it to be valid XHTML.

Valid:

Invalid:

I have no clue how to remove the div-element though, sorry.

Yes, it is one of my most hated Rails behaviours. It might be correct to
wrap input fields inside a block element, but consider this:

Test

which is correct xhtml, too. But Rails adds a second (unnecessary) div
around the input. It even hinders me in setting a custom class for this
div. I think that some of the tag logic needs to be reworked.