Skip to content

Instantly share code, notes, and snippets.

@Pinwheeler
Last active August 29, 2015 14:18
Show Gist options
  • Save Pinwheeler/063be0ba0d7a58c544be to your computer and use it in GitHub Desktop.
Save Pinwheeler/063be0ba0d7a58c544be to your computer and use it in GitHub Desktop.
<%= form_for :monster do |f| %>
<% if @monster.errors.any? %>
<div id="error_explanation">
<h2>
<%= pluralize(@monster.errors.count, "error") %> prohibited this monster from being saved:
</h2>
<ul>
<% @monster.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<p>
<%= f.label :name %><br>
<%= f.text_field :name %>
</p>
<p>
<%= f.label :cr %><br>
<%= f.text_field :cr %>
</p>
<p>
<%= f.label :terrain %><br>
<% fields_for :terrain do |terrain_fields| %>
<% terrain_fields.check_box :name %>
<% end %>
</p>
<p>
<%= f.submit %>
</p>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment