You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But it throws an error when it reaches the root route from the bullet_train gem.
Invalid route name, already in use: 'root'
You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained here:
https://guides.rubyonrails.org/routing.html#restricting-the-routes-created
The text was updated successfully, but these errors were encountered:
jagthedrummer
added a commit
to bullet-train-co/bullet_train-core
that referenced
this issue
Jan 29, 2025
Previously if you tried to declare a public root route (without a unique
`as:` reference) you'd get an `ArgumentError` saying:
```
Invalid route name, already in use: 'root'
```
Similary if you tried to declare an account scoped dashboard route (with
an `as: 'dashboard'` reference) you'd get an `ArgumentError` saying:
```
Invalid route name, already in use: 'account_dashboard'
```
Both of these errors were happening when we tried to draw default routes
after the application had already declared them.
Now we resuce the `ArgumentError` and check the message to see if it's a
complaint about a duplicate route. If so, we do nothing and let the app
use the route defined in the primary `config/routes.rb` file.
Fixesbullet-train-co/bullet_train#1656
Currently we've hard coded the root routes, but it would be nice to be able to configure them somehow.
https://github.com/bullet-train-co/bullet_train-core/blob/346d5b1adfaaec4046eece13a73b812e3645ada0/bullet_train/config/routes.rb#L7
https://github.com/bullet-train-co/bullet_train-core/blob/346d5b1adfaaec4046eece13a73b812e3645ada0/bullet_train/config/routes.rb#L19
I tried doing this:
But it throws an error when it reaches the
root
route from thebullet_train
gem.The text was updated successfully, but these errors were encountered: