Open jkolen-briq opened 5 years ago
The culprit seems to be
config.helper Rails.application.routes.url_helpers
Is there a safer way to make the main app url_helpers visible to Trestle navigation? I want to define menu entries whose paths are determined at runtime by passing a lambda for the path and then evaluating on reference in Navigation::Item.
Steps to reproduce
I'm using Trestle in a secondary engine, OurUi, that handles configuration. We'll be using it across several internal apps so we can centrally control UX. The following works fine directly with Trestle:
rails generate scaffold student name:string age:integer
rails generate trestle:install
rails generate trestle:resource Student
The following fails using the OurUi engine:rails generate scaffold student name:string age:integer
rails generate trestle:resource Student
when going to /admin/students with the errorNo route matches {:action=>"index", :controller=>"students_admin/admin", :order=>"asc", :sort=>:id}
By putting some trace puts in ActionDispatch::Journey::Formatter#generate it looks like{:action=>"index", :controller=>"students_admin/admin"}
matches fine. Not sure where to tell the app that the order and sort fields are ok.System configuration
Trestle 0.8.12 Rails 5.2.3 Ruby 2.6.2
Routes