From 6b181cacc12ccd8ffdc5ce7f2287fd20d88c24ab Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Wed, 1 Oct 2025 16:20:07 +0200 Subject: [PATCH] Don't use rename for both scenarios! --- app/views/collections/show/menu/_column.html.erb | 2 +- app/views/collections/show/menu/_column_form.html.erb | 4 ++-- app/views/collections/show/menu/_columns.html.erb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/collections/show/menu/_column.html.erb b/app/views/collections/show/menu/_column.html.erb index 2b5f0b4db..22d249126 100644 --- a/app/views/collections/show/menu/_column.html.erb +++ b/app/views/collections/show/menu/_column.html.erb @@ -21,7 +21,7 @@
- <%= render "collections/show/menu/column_form", collection: column.collection, column: column %> + <%= render "collections/show/menu/column_form", collection: column.collection, column: column, label: "Rename column" %>
diff --git a/app/views/collections/show/menu/_column_form.html.erb b/app/views/collections/show/menu/_column_form.html.erb index 84a3bc731..c98091d0b 100644 --- a/app/views/collections/show/menu/_column_form.html.erb +++ b/app/views/collections/show/menu/_column_form.html.erb @@ -1,5 +1,5 @@ -<%= form_with model: [collection, column], data: { action: "turbo:submit-end->dialog#close" } do |form| %> +<%= form_with model: [collection, column], data: { controller: "form", action: "turbo:submit-end->dialog#close turbo:submit-end->form#reset" } do |form| %> <%= form.text_field :name, class: "input", placeholder: "Column name", value: column.name, required: true, autocomplete: "off", pattern: ".*\\S.*", title: "Column name cannot be blank" %> - <%= form.submit "Rename column", class: "btn btn--link" %> + <%= form.submit label, class: "btn btn--link" %> <% end %> diff --git a/app/views/collections/show/menu/_columns.html.erb b/app/views/collections/show/menu/_columns.html.erb index 881c8448b..0d453267a 100644 --- a/app/views/collections/show/menu/_columns.html.erb +++ b/app/views/collections/show/menu/_columns.html.erb @@ -3,6 +3,6 @@ <%= icon_tag "add", class: "translucent", "aria-hidden": true %> - <%= render "collections/show/menu/column_form", collection: collection, column: Column.new %> + <%= render "collections/show/menu/column_form", collection: collection, column: Column.new, label: "Add column" %>