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.74 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.73 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.72 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.71 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.70 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.69 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.68 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.67 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.66 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.65 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.64 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.63 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.62 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.61 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.60 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.59 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.57 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.56 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.55 lib/generators/tenon/scaffold_small/templates/view__form.html.haml
tenon-1.0.54 lib/generators/tenon/scaffold_small/templates/view__form.html.haml