Redirects - #62
Conversation
01f1c7e to
61a52d6
Compare
|
This is an interesting RFC. I would imagine many people have this use case. We too had this problem, instead of creating routes that redirected on I'd probably use this if implemented. Anyways, just my $0.02. |
|
@thejameskyle This is a pretty good direction, but I have a few concerns:
|
|
has doing something like That's similiar to how react router does it. |
|
@tikotzky Yes, it's mentioned under "Alternatives". |
|
@kimroen I think that the |
Can I get a couple examples of really complex routes that I could play around with? Most of the ones I work with are fairly simple. As for the
I wasn't sure about the exact implementation semantics, however I was imagining that these would generate routes that would be functionally equivalent to how redirects are handled today. I wonder if a similar approach can be taken with how other routes are generated: Only generate a Route when it does not exist. |
|
@kimroen sorry I missed that. @MiguelMadero I agree, in my experience setting up a redirect is a one time thing that you do at the time you create the new route. For example with if you later decided to change if a user then visited |
|
I thought about pushing this down to the destination route object itself where you could create an api that has a bit more freedom to manipulate the url. Route.extend({
redirectFrom: ['bar', 'baz', {
'foo/:id': (params) {
return params;
}
}]
});Not sure about what the api would be here, but it seemed very odd to push the url down to this point. |
Fixes #62. Of the formats proposed there, I went with option (e.c).
Rendered