Sha256: bb80d2713d19295b8a2a97f25b0ebf00b564859a4b18c97e7827b77af35eea08

Contents?: true

Size: 1.15 KB

Versions: 2

Compression:

Stored size: 1.15 KB

Contents

<%%= simple_form_for(<%= "[:#{prefix}, @#{singular_table_name}]" %>) do |f| %>
<% attributes.each do |attribute| -%>
<div class="row">
<div class="col s12">
  <%= if attribute.field_type == 'date' %>
  <%%= f.input :<%= attribute.name %>, as: :string, input_html: { class: 'datepicker' } %>
  <%= elsif attribute.else_if == 'text' %>
  <%%= f.input :<%= attribute.name %>, as: :string, input_html: { class: 'materialize-textarea' } %>
  <%= elsif singular_table_name.camelize.contantize.uploaders.keys.include?(attribute.name.to_sym) %>
  <div class="image_preview">
    <%%= image_tag @<%=singular_table_name%>.<%=attribute%>.url, class: 'admin--thumb' %>
    <%%= f.input :remove_image, as: :boolean %>
  </div>
  <div class="file-field input-field">
    <div class="btn">
        <span>Image</span>
        <%%= f.input :<%= attribute.name %>, label: false, wrapper: false %>
    </div>
    <div class="file-path-wrapper">
      <input class="file-path validate" type="text" placeholder="Upload a file">
    </div>
  </div>
  <% else %>
  <%%= f.input :<%= attribute.name %> %>

<% end %>
</div>
</div>
<div class="actions">
    <%%= f.button :submit %>
</div>
<%% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
material_admin-0.0.2 lib/generators/admin/scaffold_controller/templates/views/erb/_form.html.erb.erb
material_admin-0.0.1 lib/generators/admin/scaffold_controller/templates/views/erb/_form.html.erb.erb