Sha256: 64b6c06b7317607230a9c7a99c0d017ad6992d9b75bb4fe4f6599c1e825a2eed

Contents?: true

Size: 1.12 KB

Versions: 73

Compression:

Stored size: 1.12 KB

Contents

<% collections = attributes.select {|a| a.name.match(/_id$/)}.map {|a| a.name.gsub(/_id$/, '')}.uniq -%>
= form_for @<%= singular_name %>, builder: Tenon::FormBuilder, data: {modal: true, remote: true, type: 'json', record: '<%= singular_name %>'} do |f|
  .modal-body
    .fields.full
<% collections.each do |c| %>
      .form-group
        = f.super_label :<%= c %>, '<%= c.titleize %>'
        = f.collection_select :<%=c%>_id, @<%= c.pluralize %>, :id, :title, prompt: '--'
<% end -%>

<% attributes.reject {|a| a.field_type.to_s == "text_area" || ["timestamp", "datetime"].include?(a.type.to_s) }.reject {|a| a.name.match(/_id$/)}.each do |attribute| -%>
<% if !attribute.name.match(/_content_type|_file_size|_file_name/) && !['list_order', 'published'].include?(attribute.name) -%>
      .form-group
        = f.text_field :<%= attribute.name %>
<% end -%>
<% end -%>

<% attributes.select { |a| ["datetime", "timestamp"].include?(a.type.to_s) }.each do |f| -%>
      .form-group
        = f.text_field :<%= f.name %>, data: {behaviour: 'datetimepicker'}
<% end -%>

      .spacer

  .modal-footer
    = f.submit "Save", class: 'btn btn-comp'

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
tenon-1.0.32 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.31 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.30 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.29 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.28 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.27 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.26 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.25 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.24 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.23 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.22 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.21 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.20 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.19 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.18 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.17 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.16 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.15 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.14 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.13 lib/generators/tenon/scaffold_small/templates/view__form.html.haml