aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorAndrew White <pixeltrix@users.noreply.github.com>2016-03-01 17:31:14 +0000
committerAndrew White <pixeltrix@users.noreply.github.com>2016-03-01 17:31:14 +0000
commitf2c707a64ee8683ee7bc4f1bc0254afcaa0ff676 (patch)
tree4c4680606065ff4bb7bb8e9c5ee5b9bd51b4861b /actionpack/lib
parent3e43ba67209751468857a350ded6ea40aad2a2ba (diff)
parent6520ea5f7e2215a763ca74bf6cfa87be2347d5df (diff)
downloadrails-f2c707a64ee8683ee7bc4f1bc0254afcaa0ff676.tar.gz
rails-f2c707a64ee8683ee7bc4f1bc0254afcaa0ff676.tar.bz2
rails-f2c707a64ee8683ee7bc4f1bc0254afcaa0ff676.zip
Merge pull request #23980 from rails/deprecate-controller-action-segments
Deprecate :controller and :action path parameters
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index 310e98f584..f807a8fe16 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -513,6 +513,15 @@ module ActionDispatch
route = @set.add_route(name, mapping)
named_routes[name] = route if name
+
+ if route.segment_keys.include?(:controller)
+ ActiveSupport::Deprecation.warn("Using a dynamic :controller segment in a route is deprecated and will be remove in Rails 5.1")
+ end
+
+ if route.segment_keys.include?(:action)
+ ActiveSupport::Deprecation.warn("Using a dynamic :action segment in a route is deprecated and will be remove in Rails 5.1")
+ end
+
route
end