0

I just want to do like this.

<p><form blabla></form><form blabla></form></p>

so, on rails 2.8.3 I wrote like this.

<p>
<%- form_tag blabla -%><%- end -%>
<%- form_tag blabla -%><%- end -%>
</p>

but the result is like this.

<p></p>
<form blabla></form>
<form blabla></form>
<p></p>

How can I avoid paragraph tag automatically inserted?

Hiroaki Machida
  • 1,060
  • 2
  • 12
  • 23

1 Answers1

0

It's not valid html to nest form tags inside a p tag so your browser is trying to fix it for you. http://www.w3.org/TR/html401/struct/text.html#h-9.3.1

You can verify that the browser is altering this this by:

telnet localhost 3000
GET /wherever/this/is HTTP/1.0

And you will see something like:

<p>
<form action="/dog" method="post"><div style="margin:0;padding:0;display:inline"><input name="authenticity_token" type="hidden" value="HxzAQS/UMwdXmcMzX+qk9eV49JCmwnds9bekrr3YKj0=" /></div></form><form action="/dog" method="post"><div style="margin:0;padding:0;display:inline"><input name="authenticity_token" type="hidden" value="HxzAQS/UMwdXmcMzX+qk9eV49JCmwnds9bekrr3YKj0=" /></div></form></p>
Shawn Balestracci
  • 7,380
  • 1
  • 34
  • 52