Skip to content

Instantly share code, notes, and snippets.

@evantravers
Created July 8, 2011 16:13
Show Gist options
  • Save evantravers/1072172 to your computer and use it in GitHub Desktop.
Save evantravers/1072172 to your computer and use it in GitHub Desktop.
<%= form_for(@todo) do |f| %>
<% if @todo.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@todo.errors.count, "error") %> prohibited this todo from being saved:</h2>
<ul>
<% @todo.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :name %><br />
<%= f.text_field :name %>
</div>
<div class="field">
<%= f.label :completed %><br />
<%= f.check_box :completed %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment