Forum: Ruby on Rails end_form_tag not generating </form>

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A48d102d8f5fdeed8cc87168144033d5?d=identicon&s=25 Jon Seidel (Guest)
on 2007-01-28 18:54
I put the following code at the end of my index.rhtml:
     <%= form_tag :action => 'reverse' %>
     <%= end_form_tag %>
and I get the following code generated:
     <form method="post" action="/chapter3/reverse"/>
   </body>
... no </form> tag

I've checked in ActionView::Helpers::FormTagHelper and the
"end_form_tag" seems to be defined properly.

Any suggestions as to what to look for to figure this one out?

thanks...jon
1c290a21ca0bb678e9f4f1006a13595e?d=identicon&s=25 Philipp Hofmann (phil)
on 2007-01-28 19:23
hi,

try putting something in your form. i'd guess rails reduces empty tags
to non-closing tags ending with />

hope that helps

g phil


Jon Seidel wrote:
> I put the following code at the end of my index.rhtml:
>      <%= form_tag :action => 'reverse' %>
>      <%= end_form_tag %>
> and I get the following code generated:
>      <form method="post" action="/chapter3/reverse"/>
>    </body>
> ... no </form> tag
>
> I've checked in ActionView::Helpers::FormTagHelper and the
> "end_form_tag" seems to be defined properly.
>
> Any suggestions as to what to look for to figure this one out?
>
> thanks...jon
C143acf82f94860ef6e2cba52b2de831?d=identicon&s=25 gmacgregor (Guest)
on 2007-01-28 19:26
(Received via mailing list)
I don't know why it isn't showing up but I do know that <%=
end_form_tag %> has been depreciated. Just use </form> instead.
Da653ee885a04666c4eb6b9230c80371?d=identicon&s=25 Jon Seidel (jesii7)
on 2007-01-28 21:22
Philipp Hofmann wrote:
> hi,
>
> try putting something in your form. i'd guess rails reduces empty tags
> to non-closing tags ending with />

Perfect... that was the ticket; and when you pointed it out, I finally
saw the closing /> on the original form tag itself.

Thanks much!
This topic is locked and can not be replied to.