| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Some places we can't remove because Ruby still don't have a method
equivalent to strip_heredoc to be called in an already existent string.
|
|\
| |
| |
| | |
Make `assert_recognizes` to traverse mounted engines
|
| |
| |
| |
| |
| |
| | |
Before this commit paths of mounted engines are not traversed
when `assert_recognizes` is called, causing strange test results.
This commit enable to traverse mounted paths.
|
| | |
|
| |
| |
| |
| |
| | |
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|\ \
| |/
|/|
| | |
Refactor handling of :action default in routing
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The longstanding convention in Rails is that if the :action parameter
is missing or nil then it defaults to 'index'. Up until Rails 5.0.0.beta1
this was handled slightly differently than other routing defaults by
deleting it from the route options and adding it to the recall parameters.
With the recent focus of removing unnecessary duplications this has
exposed a problem in this strategy - we are now mutating the request's
path parameters and causing problems for later url generation. This will
typically affect url_for rather a named url helper since the latter
explicitly pass :controller, :action, etc.
The fix is to add a default for :action in the route class if the path
contains an :action segment and no default is passed. This change also
revealed an issue with the parameterized part expiry in that it doesn't
follow a right to left order - as soon as a dynamic segment is required
then all other segments become required.
Fixes #23019.
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is meant to provide a way for Action Cable, Sprockets, and possibly
other Rack applications to mark themselves as internal, and to exclude
themselves from the routing inspector, and thus `rails routes` / `rake
routes`.
I think this is the only way to have mounted Rack apps be marked as
internal, within AD/Journey. Another option would be to create an array
of regexes for internal apps, and then to iterate over that everytime a
request comes through. Also, I only had the first `add_route` method set
`internal`'s default to false, to avoid littering it all over the
codebase.
|
| |
|
|
|
|
|
|
|
|
| |
Some places were saying filter, while others said filter_options, spare the ambiguity
and use filter throughout.
This inlines a needless local variable and clarifies a route filter consists of defaults
and values to match against.
|
|
|
|
|
|
|
| |
Assume the filter is a string, if it wasn't a hash and isn't nil. Remove needless else
and rely on Ruby's default nil return.
Add spaces within hash braces.
|
|
|
|
|
|
|
|
|
|
| |
Add two options: `-c` and `-g`.
`-g` option returns the urls name, verb and path fields that match the pattern.
`-c` option returns the urls for specific controller.
Fixes #18902, and Fixes #20420
[Anton Davydov & Vipul A M]
|
|
|
|
|
|
|
| |
- `CONTROLLER` argument can now be supplied in different ways (Rails::WelcomeController, Rails::Welcome, rails/welcome)
- If `CONTROLLER` argument was supplied but it does not exist, will warn the user that this controller does not exist
- If `CONTROLLER` argument was supplied and no routes could be found matching this filter, will warn the user that no routes were found matching the supplied filter
- If no routes were defined in the config/routes.rb file, will warn the user with the original message
|
|
|
|
|
|
|
|
|
| |
By [this commit](https://github.com/rails/rails/commit/0b476de445faf330c58255e2ec3eea0f3a7c1bfc)
`Journey::Route#verb` need not to return verb as regexp.
The returned value is used by inspector, so change it to be a string.
Add inspect_with_multiple_verbs test case to keep the behavior of
inspector correctly.
|
|
|
|
|
|
|
|
| |
We need to ignore the `assets_prefix` when running a command like `rake
routes`. However we cannot reference asserts_prefix from action_pack as
that is a sprockets-rails concern.
See this is now implemented on sprockets-rails
https://github.com/rails/sprockets-rails/commit/85b89c44ad40af3056899808475e6e4bf65c1f5a
|
|
|
|
|
|
|
|
| |
Change filter on /rails/info/routes to use an actual path regexp from rails
and not approximate javascript version. Oniguruma supports much more
extensive list of features than javascript regexp engine.
Fixes #18402.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Unwrap Constraints objects. I don't actually think it's possible
to pass a Constraints object to this constructor, but there were
multiple places that kept testing children of this object. I
*think* they were just being defensive, but I have no idea.
|
|
|
|
|
|
| |
fixes rails/rails#13810
Squash
|
|
|
|
| |
Closes #9625
|
| |
|
|
|
|
| |
This commit fixes formatting issue for `rake routes` task, when a section is shorter than a header.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Somehow I missed this method, which was then throwing an error
when viewing routes as HTML.
Make @rubys happy: ✔
|
| |
|
|
|
|
| |
Thanks @sikachu. :heart:
|
|
|
|
|
|
| |
Print a message in both `rake routes` and at GET "/rails/info/routes"
that lets you know you have no routes defined, as well as linking to the
Rails Guide on the topic.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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/routes` output. 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:
![](http://f.cl.ly/items/3A2F0v2m3m1Z1p3P3O3k/path-match.gif)
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.
ATP actionpack
|
| |
|
|
|
|
|
|
|
|
|
| |
This PR standardizes the output of the HTML and console based routes to not include the title for "Application Routes" those that are defined by the application. Instead only routes defined in engines get any special treatment.
Based on this conversation:
https://github.com/rails/rails/commit/af5c0fd85fce1adb311083dd1ecf96432ee8caa3#commitcomment-2458823
ATP actionpack /cc @carlosantoniodasilva
|
|
|
|
|
|
| |
It is used by the table formatter only, and it's already inside a routes
directory that namespaces it properly, so calling it just "table" seems
simpler.
|
|
|
|
|
|
|
| |
It feels more consistent to have this class called "HtmlTableFormatter",
and to have it here with the routes inspector and console formatter,
since it's used for both routing error exceptions and the rails info
page.
|
|
|
|
| |
Warning: "shadowing outer local variable - routes".
|
| |
|
| |
|
|
|
|
|
|
|
| |
This reverts commit ae68fc3864e99ab43c18fd12577744e1583f6b64, reversing
changes made to 0262a18c7b0ab6f60fee842b3007388f9ffeb0fa.
See here: https://github.com/rails/rails/pull/8499#issuecomment-11356417
|