aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2012-11-03 17:38:55 -0500
committerGuillermo Iguaran <guilleiguaran@gmail.com>2012-11-21 22:59:00 -0500
commit0d3a9e8a6b30d2bae09209eecfb3380f8c600eb6 (patch)
tree75f026fea3004c101fe5bbb958ced64fc75d3a4b /actionpack/lib/action_dispatch
parent0134ca6a0166bfddd5e6e238877c3212824f0e6e (diff)
downloadrails-0d3a9e8a6b30d2bae09209eecfb3380f8c600eb6.tar.gz
rails-0d3a9e8a6b30d2bae09209eecfb3380f8c600eb6.tar.bz2
rails-0d3a9e8a6b30d2bae09209eecfb3380f8c600eb6.zip
Allow setting a symbol as path in scope on routes
Was surprising found that this example doesn't work: scope :api do resources :users end and the right form to use it is: scope 'api' do resources :users end I think this should work similary as `namespace` where both are allowed. These two are equivalent: namespace :api do resources :users end namespace 'api' do resources :user end
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index d6fe436b68..05cbcf709e 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -644,7 +644,7 @@ module ActionDispatch
options = args.extract_options!
options = options.dup
- options[:path] = args.first if args.first.is_a?(String)
+ options[:path] = args.flatten.join('/') if args.any?
recover = {}
options[:constraints] ||= {}