diff options
Diffstat (limited to 'app/views/machines/_form.html.erb')
-rw-r--r-- | app/views/machines/_form.html.erb | 27 |
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 %> |