%%= form_for(@<%= singular_table_name %>, html: {class: 'form-horizontal'}) do |f| %>
<%% if @<%= singular_table_name %>.errors.any? %>
<%%= pluralize(@<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:
<%% @<%= singular_table_name %>.errors.full_messages.each do |msg| %>
- <%%= msg %>
<%% end %>
<%% end %>
<% attributes.each do |attribute| -%>
<%%= f.label :<%= attribute.name %>, class: 'control-label' %>
<%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
<% end -%>
<%%= f.submit <%= key_value :class, "'btn btn-primary'" %> %>
<%%= link_to 'Back', <%= plural_table_name %>_path, <%= key_value :class, "'btn btn-default'" %> %>
<%% end %>