I have a strange situation happening on a page where my tags are being closed immediately, leaving the form\'s contents on their own and not useful
My way to fix it is to include the submit button right before the end and make the button not display.
<%= submit_tag('',style: 'width:0;height:0;display:none;') %>
<% end %>
This puts the ending tag right where I need it.
I had this problem and figured it out. For me, it was because I was rendering the form in an invalid place. Specifically, I had some content like this:
<table>
<tr>
<td>
Stuff I might want to edit
</td>
<div style="display: none">
<%= form_for thing_i_might_want_to_edit %>
...
<% end %>
</div>
</tr>
</table>
Moving the hidden div (and the form inside it) into the tag fixed the problem.
What version of Rails are you using? Coz till 2.3.2 form_for didn't return back a value
<% form_for(@review) do |f| %>
Note the "=" missing at the start!