about summary refs log tree commit diff
path: root/app/views/machines/_form.html.erb
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2022-01-15 12:10:26 -0500
committerBen Harris <ben@tilde.team>2022-01-15 12:10:26 -0500
commit2c8c227493509175fcdbcba3e6a85f8b954a169e (patch)
tree56c95cb471004fef1bfa4c99e93fdec1716e3840 /app/views/machines/_form.html.erb
init
Diffstat (limited to 'app/views/machines/_form.html.erb')
-rw-r--r--app/views/machines/_form.html.erb27
1 files changed, 27 insertions, 0 deletions
diff --git a/app/views/machines/_form.html.erb b/app/views/machines/_form.html.erb
new file mode 100644
index 0000000..0e59129
--- /dev/null
+++ b/app/views/machines/_form.html.erb
@@ -0,0 +1,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 %>