Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<%= 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