New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In Browser Path Matching with Javascript #9001
Conversation
|
Wow. Just Wow. |
|
yea just wow, amazing |
|
Like! |
|
Awesome |
|
but generally looks like fun :) |
|
|
| } | ||
|
|
||
| // Ensure path always starts with a slash "/" and remove params or fragments | ||
| function sanatizePath(path) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sanitizePath for the greater spelling win.
|
|
|
|
|
A very appropriate PR for #9001! |
|
dude, killer. |
|
does this work in production? That's the only question I have. (i will admit i haven't looked at the code for this.) |
|
@jrgifford you cannot access this url in production, it is in an internal controller only added in development, and there is a before filter that will prevent anyone from accessing this page unless it is a local request. |
|
Fantastic idea! |
|
Clap Clap Clap! |
|
@schneems ah, ok. excellent! |
|
|
|
Here's to hoping we use the ability to use animated GIFs in pull requests for good, not for annoying. |
|
|
|
|
|
|
|
@drnic This PR is, indeed, over 9000. |
|
|
| @route = route | ||
| super(@route) | ||
| end | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that you're capturing the route for the regex method below? If so can't we delete this method and implement regex like this:
def regex
__get_object__.path.to_regexp
endAlso can we keep the names consistent - use regexp instead of regex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, i had never worked with SimpleDelegator before, looks like it's __getobj__
|
@schneems What did you use to make the gif? |
|
very nice |
|
|
|
That's just awesome! |
|
Awesome! |
|
lovely |
|
|
|
Dude @schneems |
|
|
|
Awesome stuff <3 |
|
awesome! |
|
Awesome!!! |
|
Amazing |
|
+1 |
|
Nice feature! |
|
Nice work! |
|
Nice |
|
|
|
Good job! |
|
very good job,thanks |
|
|
|
great! |
|
amazed |
|
|
|
love it, but what happens if i want to do |
|
Just awesome |
|
Awesome |

When debugging routes it can sometimes be difficult to understand exactly how the paths are matched. This PR adds a JS based path matching widget to the
/rails/info/routesoutput. You can enter in a path, and it will tell you which of the routes that path matches, while preserving order (top match wins).The matching widget in action:
Prior to this PR the only way to check matching paths is via mental math, or typing in a path in the url bar and seeing where it goes. This feature will be an invaluable debugging tool by dramatically decreasing the time needed to check a path match.
To newcomers: you can run this route page in Rails 3.2 (without this feature), using Sextant.
It has also been noted that this PR is: OVER 9000.
ATP actionpack