lib/generators/templates/layouts/_form.html.erb
<%= form_for(@record) do |f| %>
<% if @record.errors.any? %>
<div id="error_explanation">
<h2><%= "#{pluralize(@record.errors.count, "error")} prohibited this #{@model.to_s} from being saved:" %></h2>
<ul>
<% @record.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<%= render partial: 'form', locals: {f: f} %>
<div class="actions">
<%= f.submit %>
</div>
<% end %>