Skip to content

Instantly share code, notes, and snippets.

@johncblandii
Created March 1, 2012 06:22
Show Gist options
  • Save johncblandii/1947754 to your computer and use it in GitHub Desktop.
Save johncblandii/1947754 to your computer and use it in GitHub Desktop.
form_for failing
This fails to output the <form>.
<div>
<h2>Sign Up</h2> Already a user? <%= link_to "Sign In Here", signin_path %>
</div
<%= form_for @u do |f| %>
...form fields here...
<% end %>
Output:
<div>
<h2 class="inline">Sign Up</h2> <span>Already a user? <a href="/signin">Sign In Here</a> </span>
</div>
<form accept-charset="UTF-8" action="/users" class="new_user" id="new_user" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="pgvjDAIdhoxOvd06xgzRS77HBo1rq0sCXYIOm2vgo84=" /></div>
...
</form>
-----
This works just fine:
<h2 class="inline">Sign Up</h2> <span>Already a user? <%= link_to "Sign In Here", signin_path %> </span>
<%= form_for @u do |f| %>
...
<% end %>
Output:
<h2 class="inline">Sign Up</h2> <span>Already a user? <a href="/signin">Sign In Here</a> </span>
<form accept-charset="UTF-8" action="/users" class="new_user" id="new_user" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="pgvjDAIdhoxOvd06xgzRS77HBo1rq0sCXYIOm2vgo84=" /></div>
...
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment