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/dispatch/routing
Andrew White 35afd2c53b Add support for calling nested direct routes (#28462)
Not all requirements can be expressed in terms of polymorphic url
options so add a `route_for` method that allows calling another
direct route (or regular named route) which a set of arguments, e.g:

    resources :buckets

    direct :recordable do |recording|
      route_for(:bucket, recording.bucket)
    end

    direct :threadable do |threadable|
      route_for(:recordable, threadable.parent)
    end

This maintains the context of the original caller, e.g.

    threadable_path(threadable) # => /buckets/1
    threadable_url(threadable)  # => http://example.com/buckets/1
2017-03-17 18:07:09 +01:00
..
concerns_test.rb applies new string literal convention in actionpack/test 2016-08-06 18:54:50 +02:00
custom_url_helpers_test.rb Add support for calling nested direct routes (#28462) 2017-03-17 18:07:09 +01:00
inspector_test.rb Add three new rubocop rules 2016-08-16 04:30:11 -03:00
ipv6_redirect_test.rb stop using removed render :text 2016-12-03 15:28:59 +09:00
route_set_test.rb applies new string literal convention in actionpack/test 2016-08-06 18:54:50 +02:00