Pagnet/csv_import_magic

View on GitHub
lib/generators/templates/views/shareds/_csv_importer.html.erb

Summary

Maintainability
Test Coverage
<h1 class="page-title">
  <%= t('csv_import_magic.views.importers.new.title', model_translated: t('activemodel.models.source_value.other')) %>
  <br/>
  <small><%= t('csv_import_magic.views.importers.new.description', model_translated: t('activemodel.models.source_value.other').downcase) %></small>
</h1>

<%= simple_form_for(Importer.new, url: csv_import_magic.importers_path) do |f| %>
  <%= f.input :importable_type, as: :hidden, input_html: { value: '<change this value>' } %>
  <%= f.input :importable_id, as: :hidden, input_html: { value: '<change this value>' } %>
  <%= f.input :source, as: :hidden, input_html: { value: 'source_value' } %>

  <div class="form-row">
    <%= f.input :attachment, as: :file, hint: t('csv_import_magic.views.importers.new.hint').html_safe, required: true %>
  </div>

  <div class='form-row actions'>
    <%= f.submit t('csv_import_magic.views.importers.new.buttons.import'), class: 'button button--primary' %>
  </div>
<% end %>