Sha256: 88790785235a181d8235a8021206020b5b2376da896604e11bea74f3b2aea5dd

Contents?: true

Size: 1.16 KB

Versions: 10

Compression:

Stored size: 1.16 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', data: { disable_with: "Please wait..." }

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
tenon-1.1.8 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.1.7 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.1.6 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.1.5 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.1.4 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.1.3 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.1.2 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.1.1 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.76 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.75 lib/generators/tenon/scaffold_small/templates/view__form.html.haml