Describe the bug
I have a custom action which renders its own view. In this view, I can't use the standard Rails url/path helpers for "normal" routes in my application.
Reproduction steps
Let's say I have a specific route in my app, e.g. the following line in routes.rb.
post "/custom_action", to: "custom#custom_action", as: "custom_action"
Create a custom actions like the docs say, and add a view under views/rails_admin/main/custom_action.html.erb. In the view, try to use custom_action_path (e.g. for using as the action attribute of a form tag). When rendering the view, it blows up with undefined local variable or method custom_action_path.
Quick repro
I've created a project which demonstrates this behavior at https://github.com/matssigge/rails-admin-test. Clone the project and follow the instructions in README.md to reproduce.
Expected behavior
It should be possible to use a route helper for a "main app route" within a RailsAdmin custom action template.
Additional context
rails version: 7.0.4
rails_admin version: 3.1.0
rails_admin npm package version: 3.1.0
I tried asking about this on the mailing list/Google group, but there seems to be nobody home.
Describe the bug I have a custom action which renders its own view. In this view, I can't use the standard Rails url/path helpers for "normal" routes in my application.
Reproduction steps Let's say I have a specific route in my app, e.g. the following line in routes.rb.
Create a custom actions like the docs say, and add a view under
views/rails_admin/main/custom_action.html.erb
. In the view, try to usecustom_action_path
(e.g. for using as the action attribute of a form tag). When rendering the view, it blows up withundefined local variable or method custom_action_path
.Quick repro I've created a project which demonstrates this behavior at https://github.com/matssigge/rails-admin-test. Clone the project and follow the instructions in README.md to reproduce.
Expected behavior It should be possible to use a route helper for a "main app route" within a RailsAdmin custom action template.
Additional context
rails
version: 7.0.4rails_admin
version: 3.1.0rails_admin
npm package version: 3.1.0I tried asking about this on the mailing list/Google group, but there seems to be nobody home.