| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a route is mounted inside a resources block, it's automatically
prefixed, so a following code:
resources :users do
mount Blog::Engine => '/blog'
end
will generate a user_blog path helper.
In order to access engine helpers, we also use "mounted_helpers", a list
of helpers associated with each mounted engine, so a path to blog's post
can be generated using user_blog.post_path(user, post).
The problem I'm fixing here is that mount used a raw :as option, without
taking nestings into account. As a result, blog was added to a route set
as a `user_blog`, but helper was generated for just `blog`.
This commit applies the proper logic for defining a helper for a mounted
engine nested in resources or resource block.
(closes #8533)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A path redirect may contain any and all parts of a url which have different
escaping rules for each part. This commit tries to escape each part correctly
by splitting the string into three chunks - path (which may also include a host),
query and fragment; then it applies the correct escape pattern to each part.
Whilst using `URI.parse` would be better, unfortunately the possible presence
of %{name} parameters in the path redirect string prevents us from using it so
we have to use a regular expression instead.
Fixes #13110.
|
|\
| |
| |
| |
| |
| | |
Conflicts:
activesupport/lib/active_support/core_ext/hash/deep_merge.rb
activesupport/lib/active_support/core_ext/hash/keys.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
According to our guideline, we leave 1 space between `#` and `=>`, so we
want `# =>` instead of `#=>`.
Thanks to @fxn for the suggestion.
[ci skip]
|
| |
| |
| |
| | |
This commit fixes formatting issue for `rake routes` task, when a section is shorter than a header.
|
| |
| |
| |
| | |
Only set the value once after it's calculated.
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
| |
These errors occur when, there routes are wrongly defined.
example, the following line would cause a missing :action error
root "welcomeindex"
Mostly beginners are expected to hit these errors, so lets improve the error message a bit to make their learning experience bit better.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Example:
# application routes.rb
mount BlogEngine => '/blog'
# engine routes.rb
get '/admin' => redirect('admin/dashboard')
This now redirects to the path `/blog/admin/dashboard`, whereas before it
would've generated an invalid url because there would be no slash between
the host name and the path. It also allows redirects to work where the
application is deployed to a subdirectory of a website.
Fixes #7977
|
|\ |
|
| |
| |
| |
| |
| |
| | |
The documentation is showing the link_to method as just returning
the contents of the url_for method. It should be returning an
"<a>" tag with the correct href set.
|
|\ \
| | |
| | |
| | | |
Adding documentation and tests to ``polymorphic_url`` and ``link_to``
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
concerning the options that it inherits from +url_for+. The way that
+polymorhpic_url+ is built allows it to have options
like +:anchor+, +:script_name+, etc. but this is currently not
documented.
|
|\ \ \
| | | |
| | | | |
Fix typos: the indefinite articles(a -> an).
|
| | | | |
|
| |_|/
|/| |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit ab5cd54b7e791f8419f689d1bef5394890268a6f, reversing
changes made to cdc10c898d4865302740340eedec4f5f4ca76565.
Reason: This way of defining root path is still supported. See
https://github.com/rails/rails/blob/d262773ab7f0aae5de2d354ac2eca168e95b653d/actionpack/test/controller/routing_test.rb#L450-457
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The documentation in this section is referring to a profile,
so the resource that's created should probably also be a
profile of some sort.
|
| |/ /
| | |
| | |
| | |
| | |
| | | |
The docs refference a blacklist, but really what's being described
is a whitelist. Anything that matches the constraint gets through to
the path.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Reference:
Bloody mess internals
http://gusiev.com/slides/rails_contribution/static/#40
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
This piece of documentation is out of date.
The use of match without any via option is prevented, now
the HTTP verbs have to be explicitly set. If they're not set then
the error message in normalize_conditions! (around line 186) is
shown.
|
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 70d6e16fbad75b89dd1798ed697e7732b8606fa3, reversing
changes made to ea4db3bc078fb3093ecdddffdf4f2f4ff3e1e8f9.
Seems to be a code merge done by mistake.
|
| |
| |
| |
| |
| |
| | |
Reference:
Bloody mess internals
http://gusiev.com/slides/rails_contribution/static/#40
|
| |
| |
| |
| |
| |
| | |
Only build the missing_keys array once we have detected that there
actually are missing keys by moving the check to be part of the block
that performs the path substitution.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When optimized path helpers were re-introduced in d7014bc the test added
in a328f2f broke but no-one noticed because it wasn't being run by the
test suite.
Fix the test by checking for nil values or empty strings after the args
have been parameterized.
|
|/
|
|
|
|
|
|
|
| |
Merge `:action` from routing scope and assign endpoint if both `:controller`
and `:action` are present. The endpoint assignment only occurs if there is
no `:to` present in the options hash so should only affect routes using the
shorthand syntax (i.e. endpoint is inferred from the the path).
Fixes #9856
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When named route that is nested is used in 3.2.13
Example `routes.rb`:
```
resources :nested do
resources :builder, :controller => 'nested/builder'
end
```
In 3.2.12 and 3.2.12 this named route would work:
```
nested_builder_path(:last_step, :nested_id => "foo")
```
Generating a url that looks like `/nested/foo/builder/last_step`. This PR fixes the regression when building urls via the optimized helper. Any explicit keys set in the options are removed from the list of implicitly mapped keys.
Not sure if this is exactly how the original version worked, but this fixes this use case regression.
|
| |
|
| |
|
| |
|
|
|
|
| |
It'd be a nice convention to mark the unused variables like this, now that Ruby 2 will issue no warnings for such vars being unused.
|
|
|
|
| |
mapper) and adding a constant for all the possible scopes.
|
|\
| |
| | |
routing bugfixes when matching multiple paths
|
| |
| |
| |
| |
| |
| | |
Closes #9913.
We need to expand the match shorthand syntax for every path.
|
| |
| |
| |
| |
| |
| | |
This problem was introduced with:
https://github.com/rails/rails/commit/d03aa104e069be4e301efa8cefb90a2a785a7bff
|
| |
| |
| |
| |
| |
| |
| | |
Closes #10071
`#normalize_path!` depends on the options so we need to call
`#normalize_options!` first to make sure everything is set correctly.
|
|/ |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Rather than trying to use gsub to remove the optional route segments,
which will fail with nested optional segments, use a custom visitor
class that returns a empty string for group nodes.
Closes #9524
|
| |
|
|
|
|
|
|
|
| |
Closes #9466.
Passing `format: true` used to override the constraints: { format: /json/ }
with `/.+/`. This patch only sets the format if there is no constraint present.
|