From 0d3a9e8a6b30d2bae09209eecfb3380f8c600eb6 Mon Sep 17 00:00:00 2001 From: Guillermo Iguaran Date: Sat, 3 Nov 2012 17:38:55 -0500 Subject: 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 --- actionpack/lib/action_dispatch/routing/mapper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch') 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] ||= {} -- cgit v1.2.3