diff options
Diffstat (limited to 'app/views/operations/_form.html.erb')
-rw-r--r-- | app/views/operations/_form.html.erb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/views/operations/_form.html.erb b/app/views/operations/_form.html.erb new file mode 100644 index 0000000..adadad8 --- /dev/null +++ b/app/views/operations/_form.html.erb @@ -0,0 +1,22 @@ +<%= form_with(model: operation) do |form| %> + <% if operation.errors.any? %> + <div style="color: red"> + <h2><%= pluralize(operation.errors.count, "error") %> prohibited this operation from being saved:</h2> + + <ul> + <% operation.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.submit %> + </div> +<% end %> |