| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
Backport of 37b4276
|
|
|
| |
Was forgotten in a72dab0.
|
|
|
|
|
|
|
|
|
| |
Backport #9361.
Closes #7554.
This patch determines the `controller#action` directly
in the `match` method when the shorthand syntax is used.
this prevents problems with namespaces and scopes.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ruby 1.9 freezes Hash string keys by default so where a route is
defined like this:
get 'search' => 'search'
then the Mapper will derive the action from the key. This blows up
later when the action is added to the parameters hash and the
encoding is forced.
Closes #3429
|
|
|
|
| |
this is a backport of #8115 to fix #7842
|
|
|
|
|
|
|
|
|
| |
This reverts commit 61d5d2d8a97fd289b81991cd79dca3112e7ca135.
Conflicts:
actionpack/CHANGELOG.md
REASON: This added a backward incompatible change.
|
|
|
|
| |
resource and resources do no longer modify passed options
|
|
|
|
|
|
| |
Removing to_shorthand to fix #6497
Conflicts:
actionpack/CHANGELOG.md
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Optional segments with a root scope need to have the leading slash
outside of the parentheses, otherwise the generated url will be empty.
However if the route has non-optional elements then the leading slash
needs to remain inside the parentheses otherwise the generated url
will have two leading slashes, e.g:
Blog::Application.routes.draw do
get '/(:category)', :to => 'posts#index', :as => :root
get '/(:category)/author/:name', :to => 'posts#author', :as => :author
end
$ rake routes
root GET /(:category)(.:format) posts#index
author GET (/:category)/author/:name(.:format) posts#author
This change adds support for optional segments that contain a slash,
allowing support for urls like /page/2 for the root path, e.g:
Blog::Application.routes.draw do
get '/(page/:page)', :to => 'posts#index', :as => :root
end
$ rake routes
root GET /(page/:page)(.:format) posts#index
Fixes #7073
(cherry picked from commit d8745decaf59aad32aa2f09abdba99b8d0e48b31)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A callable object passed as a constraint for a route may access the request
parameters as part of its check. This causes the combined parameters hash
to be cached in the environment hash. If the constraint fails then any subsequent
access of the request parameters will be against that stale hash.
To fix this we delete the cache after every call to `matches?`. This may have a
negative performance impact if the contraint wraps a large number of routes as the
parameters hash is built by merging GET, POST and path parameters.
Fixes #2510.
(cherry picked from commit 56030506563352944fed12a6bb4793bb2462094b)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If you used dynamic constraint like that:
scope :constraint => MyConstraint.new do
mount RackApp => "/foo"
end
routes were not displayed correctly when using `rake routes`.
This commit fixes it. If you want nice display of dynamic
constraints in `rake routes` output, please just override
to_s method in your constraint's class.
|
| |
|
|
|
| |
`path_names` can only be used for affecting `new` and `edit`
|
|
|
|
| |
This reverts commit 3178cc9a80262d3bf7754f3507ef60243b46634f.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Fix double slash at start of paths when mounting an engine at the root.
|
| |
| |
| |
| | |
Avoids double slash at start of paths when mounting an engine at the root.
|
| | |
|
|/ |
|
|\
| |
| | |
We don't need to require erb here.
|
| | |
|
|\ \
| |/
|/| |
Inline resources router fix
|
| | |
|
| |
| |
| |
| | |
This fixes a bug that is caused by Resource/SingletonResource mangling resource options when using inline "multi"-resource declarations.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
When format is true, it is mandatory (as opposed to :format => false).
This is currently not possible with resource routes, which automatically
make format optional by default.
|
|/
|
|
|
| |
addresses issue #1907 - any routes that follow a route with a constraints
block are inheriting the previous route's constraints.
|
|
|
|
|
|
|
|
|
|
| |
Previously it was:
{:controller=>"photos", :action=>"show", :id=>/[A-Z]\d{5}/}
Now it becomes:
photos#show {:id=>/[A-Z]\d{5}/}
|
| |
|
|\ |
|
| | |
|