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.
Jon Seidel (Guest)
on 2007-01-28 19: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
Philipp H. (Guest)
on 2007-01-28 20: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
gmacgregor (Guest)
on 2007-01-28 20: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.
Jon S. (Guest)
on 2007-01-28 22:22
Philipp H. 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.