- content_for :page_header do %p= link_to t('back'), admin_<%= controller_routing_path %>_path, :class => "bright_link" %h1 - if @<%= resource_name %>.new_record? = "#{t 'add'} #{<%= @model_name.demodulize %>.model_name.human}" - else = "#{t 'edit'} #{<%= @model_name.demodulize %>.model_name.human}" = form_for [:admin, @<%= resource_name %>] do |f| - if @<%= resource_name %>.errors.any? #error_explanation %h2= "#{t 'save_errors'}: #{@<%= resource_name %>.errors.count}" %ul - @<%= resource_name %>.errors.full_messages.each do |msg| %li= msg %table <%- columns.each do |column| -%> <%- unless column.name == "position" || column.name == "ancestry" %> <%- if column.field_type.to_s == "text_area" -%> %tr %td{colspan: 2} = f.label :<%= column.name %> %br = f.<%= column.field_type -%> :<%= column.name %> <%- elsif column.field_type.to_s == "check_box" -%> %tr %th{colspan: 2} = f.<%= column.field_type -%> :<%= column.name %> = f.label :<%= column.name %> <%- else -%> %tr %th= f.label :<%= column.name %> %td= f.<%= column.field_type -%> :<%= column.name %> <%- end -%> <%- end -%> <%- end -%> .actions = f.submit t('save')