In my plugin routes, I had the following (not these exact names, but hopefully the point is clear)
get "/u/:username/thing" => "user_thing#index", constraints: { username: RouteFormat.username }
get "/u/:username/thing/setup" => "user_thing#setup_index", constraints: { username: RouteFormat.username }
post "/u/:username/thing/setup" => "user_thing#setup", constraints: { username: RouteFormat.username }
My route map was:
export default function() {
this.route(
'user',
{ path: '/u/:username', resetNamespace: true},
function() {
this.route('thing', function() {
this.route('setup')
})
}
)
}
This has worked so far. Recently, I wanted to add the new routes (note: theyāre aligned to root):
resource :thing_foobar, path: "thing/foobar/:foobar_id"
(Writing these fake names is becoming difficult )
Now my route map is:
export default function() {
this.route(
'user',
{ path: '/u/:username', resetNamespace: true},
function() {
this.route('thing', function() {
this.route('setup')
})
}
)
this.route(
'thing',
function() {
this.route('redirect', { path: '/foobar/:foobar_id' })
}
)
}
Going to mysite.tld/thing/foobar/1, I get redirected to /404
I check my network and I have the following 404:
http://mysite.tld/foobars/1?_=1537817415772
What? Why is it requesting a plural form of my route instead of the actual route? Is it because itās a relative path or something? I donāt understand.