bullet_train-core icon indicating copy to clipboard operation
bullet_train-core copied to clipboard

Namespaced route with super scaffolding is missing sortable routes

Open jagthedrummer opened this issue 1 year ago • 10 comments

https://discord.com/channels/836637622432170028/836637623048601633/1146858936356577431

In that discord link @wesgarrison reports:

New namespaced resource with super-scaffold with --sortable and the route can't be found with <%= url_for [:reorder, :account, context, collection] %>

rails routes does not show me the route.

I see draw "concerns" at the top of the config/routes

Looks like the sortable gem adds a concern for the route, but super scaffold only adds it for 1 of the conditional branches

https://github.com/bullet-train-co/bullet_train-core/blob/174405726eee47fcf7b8e8c59cb43f3a1d60aead/bullet_train-super_scaffolding/lib/scaffolding/routes_file_manipulator.rb#L379

Looks like that was it, I added , concerns: [:sortable] to the route for the namespaced child and now I see the routes

jagthedrummer avatar Sep 01 '23 13:09 jagthedrummer