[PATCH] Router#redirect
Reported by coryodaniel(midget_nuts|codaniel) | May 6th, 2008 @ 08:25 PM | in 0.9.4
it would be pretty sweet to have a feature where you could do:
r.match("/this/old/url").redirect("http://example.com/where/this/resides/now")
Comments and changes to this ticket
-
-

GMFlash June 5th, 2008 @ 07:28 PM
+1 on that
-
Michael Klishin (antares) May 11th, 2008 @ 07:38 AM
- → Milestone changed from to 0.9.4
- → State changed from new to open
-
Michael Klishin (antares) May 11th, 2008 @ 08:33 AM
And there should be second parameter for permanent / non-permanent flag to use either 301 or 302 status.
-
Michael Klishin (antares) May 12th, 2008 @ 11:27 AM
- no changes were found...
-
coryodaniel(midget_nuts|codaniel) May 12th, 2008 @ 05:06 PM
I didn't submit a patch, I am not familiar enough with the Router class to do one as of yet. That why I submitted it as Feature Request rather than Feature Patch.
If no one picks up this ticket to do it, I can give it a try this weekend, but I need to familiarize with Router, so I dont break a bunch of stuff.
-
Michael Klishin (antares) May 12th, 2008 @ 08:42 PM
I am writing low(-er) level specs for Router. So it would be easier for you to understand the router.
See spec/private/router/ in -core.
-
Michael Klishin (antares) May 13th, 2008 @ 06:35 AM
- no changes were found...
-
Michael Klishin (antares) May 15th, 2008 @ 05:23 PM
- → Assigned user changed from to Michael Klishin (antares)
-
Michael Klishin (antares) May 15th, 2008 @ 05:29 PM
Halfway done with this.
-
Yehuda Katz (wycats) June 5th, 2008 @ 08:13 PM
- → Milestone cleared.
- → State changed from open to new
- → Assigned user cleared.
@antares What's the status on this?
-
Michael Klishin (antares) June 6th, 2008 @ 01:53 AM
Halfway done. One person at #merb wanted to work on it but never shown up again. I think I can get to it over the weekend.
What is left is actual redirection instead of dispatch when matching route found to be redirecting.
-
coryodaniel(midget_nuts|codaniel) June 6th, 2008 @ 11:08 AM
that was me sorry, i saw the "halfway done with this" and didn't bother attempting it myself. if you dont have time let me know and I'll get on it like RKelly on teenagers.
-
Michael Klishin (antares) June 6th, 2008 @ 05:51 PM
Cory: ok, go for it.
-
Michael Klishin (antares) June 6th, 2008 @ 05:55 PM
Cory: you need to check matched route's behavior (use index returned by Merb::Router.match to get route) for if redirecting? returns true and redirect instead of processing with dispatch in Dispatcher#handle.
-
-
coryodaniel(midget_nuts|codaniel) June 16th, 2008 @ 08:42 PM
Imanidiotandforgottodothis.
Here it is:
r.match("/my/old/url").redirect("http://example.com")
-
Michael Klishin (antares) June 24th, 2008 @ 09:23 PM
- → Milestone changed from to 0.9.4
- → State changed from new to open
- → Title changed from Router#redirect [Feature request] to [PATCH] Router#redirect
Cory,
Well done man! Could you update your patch so it applies against HEAD? Thanks!
-
Michael Klishin (antares) June 24th, 2008 @ 10:18 PM
- → State changed from open to resolved
- → Assigned user changed from to Michael Klishin (antares)
Manually applied, thank you.
-
Carl July 7th, 2008 @ 04:15 PM
- → Tag changed from to merb-core patch router
I love this feature, thank you!
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
