1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/test
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 Revert "ActionController::Base#process() now only takes an action name" 2015-10-29 16:18:27 -07:00
assertions Add both HTTP Response Code and Type to assertion messages 2016-01-12 13:09:00 -07:00
controller Refactor handling of :action default in routing 2016-02-16 09:52:26 +00:00
dispatch Refactor handling of :action default in routing 2016-02-16 09:52:26 +00:00
fixtures Merge pull request #22800 from dgynn/pr_cache_helper_options 2016-01-29 00:15:19 -05:00
journey Remove TestRouter#add_routes 2015-09-29 13:43:11 +09:00
lib/controller Removing unused fake models 2014-09-07 22:51:14 -03:00
routing Remove deprecate *_path helpers in email views 2015-01-04 11:58:42 -03:00
tmp
abstract_unit.rb do not run in parallel on travis 2016-01-12 15:55:47 -08:00