%%= form_for(@<%= singular_table_name %>, html: {class: 'form-horizontal'}) do |f| %>
<%%= render(partial: 'shared/errors', locals: {model: @<%= singular_table_name %>}) %>
<% 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 %>