Skip to content

Instantly share code, notes, and snippets.

@andyjbas
Created September 15, 2012 00:36
Show Gist options
  • Save andyjbas/3725813 to your computer and use it in GitHub Desktop.
Save andyjbas/3725813 to your computer and use it in GitHub Desktop.
<%= form_for(@order) do |f| %>
<% if @order.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@order.errors.count, "error") %> prohibited this order from being saved:</h2>
<ul>
<% @order.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<%= f.fields_for :line_items do |l| %>
<%= l.label :notes %>
<%= l.text_field :notes %>
<%= l.label :units %>
<%= l.text_field :units %>
<% end %>
<%= f.submit %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment