<%= pluralize(condition.errors.count, "error") %> prohibited this condition from being saved:
-
-
- <% condition.errors.each do |error| %>
-
<%= error.full_message %>
- <% end %>
-
-
- <% end %>
+ <%= render(FormErrorsComponent.new(errors: condition.errors)) do %>
+ <%= pluralize(condition.errors.count, "error") %> prohibited this condition from being saved:
+ <% end if condition.errors.any? %>
+
+
+ <%= link_to '← Back to filters list', filters_path, class: "hover:text-blue-700" %>
+
\ No newline at end of file
diff --git a/app/views/operations/_form.html.erb b/app/views/operations/_form.html.erb
index 433f14b..9a1d587 100644
--- a/app/views/operations/_form.html.erb
+++ b/app/views/operations/_form.html.erb
@@ -1,16 +1,8 @@
<%= form_with(model: [ operation.filter, operation ],
data: { controller: "reset_form", operation: "turbo:submit-end->reset_form#reset" }) do |form| %>
- <% if operation.errors.any? %>
-
-
<%= pluralize(operation.errors.count, "error") %> prohibited this operation from being saved:
-
-
- <% operation.errors.each do |error| %>
-
<%= error.full_message %>
- <% end %>
-
-
- <% end %>
+ <%= render(FormErrorsComponent.new(errors: operation.errors)) do %>
+ <%= pluralize(operation.errors.count, "error") %> prohibited this operation from being saved:
+ <% end if operation.errors.any? %>