<%- @orm.column_fields.each_with_index do |column, index| -%>
- error = <%= @orm.has_error(column[:name]) %>
%fieldset.control-group{class: error ? 'has-error' : ''}
  =f.label :<%= column[:name] %>, class: 'control-label'
  .controls
    <% if column[:field_type] == :text_area %>~<% else %>=<% end %>f.<%= column[:field_type] %> :<%= column[:name] %>, class: 'form-control input-large input-with-feedback'<%- if (index == 0) -%>, autofocus: true<%- end -%>

    %span.help-inline=error ? f.error_message_on(:<%= column[:name] %>, class: 'text-error') : pat(:example)
<%- end -%>

.form-actions
  =f.submit pat(:save), class: 'btn btn-primary'
  &nbsp;
  =f.submit pat(:save_and_continue), class: 'btn btn-info', name: 'save_and_continue'
  &nbsp;
  =link_to pat(:cancel), url(:<%= @orm.name_plural %>, :index), class: 'btn btn-default'
