aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb10
-rw-r--r--actionpack/lib/action_dispatch/routing/route.rb7
2 files changed, 7 insertions, 10 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 3fac9a0d0e..3999bd0a5e 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -910,7 +910,7 @@ module ActionDispatch
alias :member_name :singular
- # Checks for uncountable plurals, and appends "_index" if the plural
+ # Checks for uncountable plurals, and appends "_index" if the plural
# and singular form are the same.
def collection_name
singular == plural ? "#{plural}_index" : plural
@@ -1083,9 +1083,13 @@ module ActionDispatch
# Is the same as:
#
# resources :posts do
- # resources :comments
+ # resources :comments, :except => [:show, :edit, :update, :destroy]
# end
- # resources :comments
+ # resources :comments, :only => [:show, :edit, :update, :destroy]
+ #
+ # This allows URLs for resources that otherwise would be deeply nested such
+ # as a comment on a blog post like <tt>/posts/a-long-permalink/comments/1234</tt>
+ # to be shortened to just <tt>/comments/1234</tt>.
#
# [:shallow_path]
# Prefixes nested shallow routes with the specified path.
diff --git a/actionpack/lib/action_dispatch/routing/route.rb b/actionpack/lib/action_dispatch/routing/route.rb
index a049510182..10b3d38346 100644
--- a/actionpack/lib/action_dispatch/routing/route.rb
+++ b/actionpack/lib/action_dispatch/routing/route.rb
@@ -1,5 +1,3 @@
-require 'active_support/core_ext/module/deprecation'
-
module ActionDispatch
module Routing
class Route #:nodoc:
@@ -47,11 +45,6 @@ module ActionDispatch
@segment_keys ||= conditions[:path_info].names.compact.map { |key| key.to_sym }
end
- def to_a
- [@app, @conditions, @defaults, @name]
- end
- deprecate :to_a
-
def to_s
@to_s ||= begin
"%-6s %-40s %s" % [(verb || :any).to_s.upcase, path, requirements.inspect]