Skip to content

Instantly share code, notes, and snippets.

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>
<% upload_csv.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
<% end %>
<div class="field">
<%= form.label :csv_file %>
<%= form.file_field :csv_file %>
<div class="actions">
<%= form.submit %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment