@@ -470,7 +470,7 @@ module Base
470
470
# When a pattern points to an internal route, the route's `:action` and
471
471
# `:controller` should be set in options or hash shorthand. Examples:
472
472
#
473
- # match 'photos/:id' => 'photos#show', via: :get
473
+ # match 'photos/:id', to: 'photos#show', via: :get
474
474
# match 'photos/:id', to: 'photos#show', via: :get
475
475
# match 'photos/:id', controller: 'photos', action: 'show', via: :get
476
476
#
@@ -614,18 +614,14 @@ def match(path, options = nil)
614
614
#
615
615
# mount SomeRackApp, at: "some_route"
616
616
#
617
- # Alternatively:
618
- #
619
- # mount(SomeRackApp => "some_route")
620
- #
621
617
# For options, see `match`, as `mount` uses it internally.
622
618
#
623
619
# All mounted applications come with routing helpers to access them. These are
624
620
# named after the class specified, so for the above example the helper is either
625
621
# `some_rack_app_path` or `some_rack_app_url`. To customize this helper's name,
626
622
# use the `:as` option:
627
623
#
628
- # mount(SomeRackApp => "some_route", as: "exciting")
624
+ # mount(SomeRackApp, at: "some_route", as: "exciting")
629
625
#
630
626
# This will generate the `exciting_path` and `exciting_url` helpers which can be
631
627
# used to navigate to this mounted app.
@@ -649,7 +645,15 @@ def mount(app, options = nil)
649
645
MSG
650
646
ActionDispatch . deprecator . warn ( <<-MSG . squish ) if hash_key_app
651
647
Mounting an engine with a hash key name is deprecated and
652
- will be removed in Rails 8.1. Please use the at: option instead.
648
+ will be removed in Rails 8.1. Please use the `at:` option instead.
649
+
650
+ Instead of:
651
+
652
+ mount(SomeRackApp => "some_route")
653
+
654
+ Please use:
655
+
656
+ mount SomeRackApp, at: "some_route"
653
657
MSG
654
658
655
659
rails_app = rails_app? app
@@ -1677,7 +1681,6 @@ def draw(name)
1677
1681
# Matches a URL pattern to one or more routes. For more information, see
1678
1682
# [match](rdoc-ref:Base#match).
1679
1683
#
1680
- # match 'path' => 'controller#action', via: :patch
1681
1684
# match 'path', to: 'controller#action', via: :post
1682
1685
# match 'path', 'otherpath', on: :member, via: :get
1683
1686
def match ( path , *rest , &block )
@@ -1689,8 +1692,16 @@ def match(path, *rest, &block)
1689
1692
1690
1693
ActionDispatch . deprecator . warn ( <<-MSG . squish )
1691
1694
Drawing a route with a hash key name is deprecated and
1692
- will be removed in Rails 8.1. Please use the to: option with
1695
+ will be removed in Rails 8.1. Please use the ` to:` option with
1693
1696
"controller#action" syntax instead.
1697
+
1698
+ Instead of:
1699
+
1700
+ match "path" => "controller#action`
1701
+
1702
+ Please use:
1703
+
1704
+ match "path", to: "controller#action"
1694
1705
MSG
1695
1706
1696
1707
case to
0 commit comments