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.53 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.52 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.51 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.50 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.49 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.48 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.47 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.46 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.45 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.44 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.43 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.42 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.41 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.40 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.39 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.38 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.37 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.36 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.35 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.33 lib/generators/tenon/scaffold_small/templates/view__form.html.haml