File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
lib/action_dispatch/routing Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1571,6 +1571,12 @@ def match(path, *rest)
15711571 options = path
15721572 path , to = options . find { |name , _value | name . is_a? ( String ) }
15731573
1574+ if path . nil?
1575+ ActiveSupport ::Deprecation . warn 'Omitting the route path is deprecated. ' \
1576+ 'Specify the path with a String or a Symbol instead.'
1577+ path = ''
1578+ end
1579+
15741580 case to
15751581 when Symbol
15761582 options [ :action ] = to
Original file line number Diff line number Diff line change @@ -402,6 +402,9 @@ def test_pagemarks
402402 post "create" , :as => ""
403403 put "update"
404404 get "remove" , :action => :destroy , :as => :remove
405+ tc . assert_deprecated do
406+ get action : :show , as : :show
407+ end
405408 end
406409 end
407410
@@ -420,6 +423,10 @@ def test_pagemarks
420423 get '/pagemark/remove'
421424 assert_equal 'pagemarks#destroy' , @response . body
422425 assert_equal '/pagemark/remove' , pagemark_remove_path
426+
427+ get '/pagemark'
428+ assert_equal 'pagemarks#show' , @response . body
429+ assert_equal '/pagemark' , pagemark_show_path
423430 end
424431
425432 def test_admin
You can’t perform that action at this time.
0 commit comments