pinrails/app/views/machines/_form.html.erb

28 lines
628 B
Plaintext

<%= form_with(model: machine) do |form| %>
<% if machine.errors.any? %>
<div style="color: red">
<h2><%= pluralize(machine.errors.count, "error") %> prohibited this machine from being saved:</h2>
<ul>
<% machine.errors.each do |error| %>
<li><%= error.full_message %></li>
<% end %>
</ul>
</div>
<% end %>
<div>
<%= form.label :name, style: "display: block" %>
<%= form.text_field :name %>
</div>
<div>
<%= form.label :edition, style: "display: block" %>
<%= form.text_field :edition %>
</div>
<div>
<%= form.submit %>
</div>
<% end %>