<% excluded_columns ||= [] %> <% additional_columns ||= [] %> <% restricted_columns ||= {} %> <% nested_resource ||= false %> <% parent_resource ||= false %> <% back_link ||= false %> <% box_class ||= 'primary' %> <% show_columns ||= [] %> <% form_fields ||= (object.class.respond_to?('form_fields') ? object.class.form_fields : {}) %> <% form_ordered_fields ||= (form_fields.empty? ? object.class.column_names : form_fields.keys) %> <% if show_columns.empty? %> <% show_columns = form_ordered_fields - ['id', 'created_at', 'updated_at', 'deleted_at'] - excluded_columns + additional_columns %> <% end %> <%= simple_form_for(nested_resource ? [parent_resource, object] : object) do |f| %>

Dados do <%= object.class.model_name.human %> <% if parent_resource %> <%= link_to 'Cancelar', eval_with_rescue("#{parent_resource.class.model_name.to_s.downcase}_#{controller_name}_path(#{parent_resource.id})"), class: "btn btn-default btn-xs" %> <% else %> <%= link_to 'Cancelar', eval_with_rescue("#{controller_name}_path"), class: "btn btn-default btn-xs" %> <% end %> <%= f.submit 'Salvar', class: "btn btn-#{box_class} btn-xs" %>

<%= render 'shared/fields', object: object, f: f, excluded_columns: excluded_columns, additional_columns: additional_columns, restricted_columns: restricted_columns, show_columns: show_columns %>
<% end %>