Sha256: ad42f014f900dc28ab4519cead9f49a47465caffe228b2f992202a041cf5ad5f

Contents?: true

Size: 1.25 KB

Versions: 8

Compression:

Stored size: 1.25 KB

Contents

- 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" %>
    <%- 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')

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ideyabox-0.1.9 lib/generators/ideyabox/scaffold/templates/edit.html.haml
ideyabox-0.1.8 lib/generators/ideyabox/scaffold/templates/edit.html.haml
ideyabox-0.1.7 lib/generators/ideyabox/scaffold/templates/edit.html.haml
ideyabox-0.1.6 lib/generators/ideyabox/scaffold/templates/edit.html.haml
ideyabox-0.1.5 lib/generators/ideyabox/scaffold/templates/edit.html.haml
ideyabox-0.1.4 lib/generators/ideyabox/scaffold/templates/edit.html.haml
ideyabox-0.1.3 lib/generators/ideyabox/scaffold/templates/edit.html.haml
ideyabox-0.1.2 lib/generators/ideyabox/scaffold/templates/edit.html.haml