about summary refs log tree commit diff
path: root/app/views/machines/_form.html.erb
blob: 0e59129bfed74125d0eb1ba278bf5d7864deef66 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<%= 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 %>