Skip to content

Instantly share code, notes, and snippets.

@dipak-tntra
Created December 28, 2020 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dipak-tntra/4d524a858bba6ed03313c79109345151 to your computer and use it in GitHub Desktop.
Save dipak-tntra/4d524a858bba6ed03313c79109345151 to your computer and use it in GitHub Desktop.
<%= form_with(model: upload_csv, local: true) do |form| %>
<% if upload_csv.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(upload_csv.errors.count, "error") %> prohibited this upload_csv from being saved:</h2>
<ul>
<% upload_csv.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= form.label :csv_file %>
<%= form.file_field :csv_file %>
</div>
<div class="actions">
<%= form.submit %>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment