Sha256: 0d1ba37320f64a0b8c40cee3b214a2cf54c1ab155bb41c751b3132d545a5957b

Contents?: true

Size: 1.03 KB

Versions: 6

Compression:

Stored size: 1.03 KB

Contents

- content_for :page_header do
  %h1
    - if @<%= resource_name %>.new_record?
      Добавить #{taccusative(:<%= resource_name %>)}
    - else
      Редактировать #{taccusative(:<%= resource_name %>)}
  %p= link_to 'Назад', [:admin, :<%= plural_resource_name %>]

= form_for [:admin, @<%= resource_name %>] do |f|
  = render 'validate', { f: f }
  %table
    <%- columns.each do |column| -%>
    <%- 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 %>
    <%- elsif column.name != 'position' -%>
    %tr
      %th= f.label :<%= column.name %>
      %td= f.<%= column.field_type -%> :<%= column.name %>
    <%- end -%>
    <%- end -%>
  .actions
    = f.submit 'Сохранить'
    = f.submit 'Применить'

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
redde-0.1.13 lib/generators/redde/scaffold/templates/edit.html.haml
redde-0.1.12 lib/generators/redde/scaffold/templates/edit.html.haml
redde-0.1.11 lib/generators/redde/scaffold/templates/edit.html.haml
redde-0.1.10 lib/generators/redde/scaffold/templates/edit.html.haml
redde-0.1.9 lib/generators/redde/scaffold/templates/edit.html.haml
redde-0.1.8 lib/generators/redde/scaffold/templates/edit.html.haml