From 6584c01b0aba7b0ca81f3f1f587b9f723618e047 Mon Sep 17 00:00:00 2001 From: Adam Rice Date: Sat, 28 Jun 2025 13:12:16 +1000 Subject: [PATCH] Support namespaced classes If a class is namespaced, e.g. `Sales::Order`, loading the dashboard will cause an error like: `undefined method 'export_admin_sales/orders_path'` --- app/views/admin/application/_index_header.html.erb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/admin/application/_index_header.html.erb b/app/views/admin/application/_index_header.html.erb index 1dfb610..4aea7a1 100644 --- a/app/views/admin/application/_index_header.html.erb +++ b/app/views/admin/application/_index_header.html.erb @@ -27,7 +27,12 @@ <%= link_to( 'Export', - [:export, namespace, page.resource_name.to_s.pluralize.to_sym, sanitized_order_params(page, :id).to_h.merge(format: :csv)], + [ + :export, + namespace, + page.resource_name.to_s.pluralize.tr("/", "__").to_sym, + sanitized_order_params(page, :id).to_h.merge(format: :csv) + ], class: 'button', target: '_blank' ) if valid_action?(:export) && show_action?(:export, resource_name) %>