| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
|/
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Closes #9432.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The current implementation only works correctly if you supply the `:controller`
with directory notation (eg. `:controller => 'admin/posts'`).
The ruby constant notation (eg. `:controller => 'Admin::Posts`) leads to unexpected problems with `url_for`.
This patch prints a warning for every non supported `:controller` option. I also added documentation how
to work with namespaced controllers. The warning links to that documentation in the rails guide.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 commit changes route defaults so that explicit defaults are no
longer required where the key is not part of the path. For example:
resources :posts, bucket_type: 'posts'
will be required whenever constructing the url from a hash such as a
functional test or using url_for directly. However using the explicit
form alters the behavior so it's not required:
resources :projects, defaults: { bucket_type: 'projects' }
This changes existing behavior slightly in that any routes which
only differ in their defaults will match the first route rather
than the closest match.
Closes #8814
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This now allows the use of arrays like this:
get '/foo/:action', to: 'foo', constraints: { subdomain: %w[www admin] }
or constraints where the request method returns an Fixnum like this:
get '/foo', to: 'foo#index', constraints: { port: 8080 }
Note that this only applies to constraints on the request - path
constraints still need to be specified as Regexps as the various
constraints are compiled into a single Regexp.
|
| |
|
| |
|
|
|
|
| |
The response body needs to respond_to? :each.
|
|\
| |
| |
| |
| | |
JoeyButler/action_dispatch_routing_mapper_refactoring
Extract method refactoring.
|
| | |
|
|\ \
| | |
| | |
| | |
| | | |
Conflicts:
guides/source/migrations.md
|
| |/ |
|
|/
|
|
|
|
| |
be ignored. A regular expression constraint gets overwritten when the
routes.rb file is processed. Changed the overwriting to an ||= instead
of an = assignment.
|
|
|
|
|
|
|
|
|
| |
This yields a small bit of performance improvement when building the
defaults from constraints, specially considering that it's rather common
for constraints to be empty.
Also, there's a bit of duplicated code in here that I have to check
before extracting.
|
| |
|
|
|
|
|
|
| |
Instead of iterating again over the options and setting one by one, we
can just merge the recover hash back to the scope one since all keys
match.
|
|
|
|
|
| |
Use the same :blocks key in the recover hash to revert the scope options
later.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Was surprising found that this example doesn't work:
scope :api do
resources :users
end
and the right form to use it is:
scope 'api' do
resources :users
end
I think this should work similary as `namespace` where both are allowed.
These two are equivalent:
namespace :api do
resources :users
end
namespace 'api' do
resources :user
end
|
|\
| |
| |
| |
| | |
Conflicts:
actionpack/lib/action_dispatch/routing/redirection.rb
|
| | |
|
| | |
|
|/ |
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
actionpack/lib/action_controller/metal/mime_responds.rb
activerecord/lib/active_record/attribute_methods.rb
guides/source/working_with_javascript_in_rails.md
|
| | |
|