1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/lib/action_dispatch
Andrew White 8ca8a2d773 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.
2016-02-16 09:52:26 +00:00
..
http Add SVG as a default mime type 2016-02-07 15:34:13 +01:00
journey Refactor handling of :action default in routing 2016-02-16 09:52:26 +00:00
middleware Join values using '; ' as per RFC spec 2016-02-16 05:59:43 +00:00
request Fix typo in docs [ci skip] 2016-01-14 11:04:08 +08:00
routing Refactor handling of :action default in routing 2016-02-16 09:52:26 +00:00
testing Add fixes accidentally removed. 2016-02-12 20:13:48 +01:00
journey.rb
railtie.rb pass a config to the route set 2015-03-05 13:12:06 -08:00
routing.rb - Fixed and removed long arguments to rake routes 2016-02-12 14:35:57 +05:30