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
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
..
abstract_controller fix permitted? conditional for render calls 2016-01-26 18:00:49 -08:00
action_controller Remove const_missing which fallback to deprecated NEVER_UNPERMITTED_PARAMS 2016-02-15 04:17:24 +09:00
action_dispatch Refactor handling of :action default in routing 2016-02-16 09:52:26 +00:00
action_pack Preparing for Rails 5.0.0.beta2 2016-02-01 14:37:52 -07:00
abstract_controller.rb Remove not used requires 2015-09-01 20:36:47 +02:00
action_controller.rb Re-add ActionController::ApiRendering 2016-01-20 19:16:23 -05:00
action_dispatch.rb Add both HTTP Response Code and Type to assertion messages 2016-01-12 13:09:00 -07:00
action_pack.rb Update copyright notices to 2016 [ci skip] 2015-12-31 18:27:19 +02:00