Doesn't work in scopes #4

Open
gauthier-delacroix opened this Issue Jan 10, 2013 · 2 comments

Projects

None yet

2 participants

@gauthier-delacroix

Note : I see I've got another problem with my scope (path) so I have to recheck in case both problems are linked.

Hi !

Concerns doesn't seems to work with scopes :

concern :deployable do
   get :deploy, :undeploy, on: :member
end

scope path: 'probes/:type', concerns: :deployable do
   resource  :probes, except: [:new, :index]          # Single probes (no ID)
   resources :probes, except: [:new, :index, :create] # Multiple probes
end

gives

                                         POST   /platforms/probes/:type/:platform_name(/:sub_platform_name)/probes(.:format)                      platforms/probes#create {:platform_name=>/[A-Z0-9][^\/\?.#]+/, :sub_platform_name=>/[A-Z0-9][^\/\?.#]+/, :type=>/[A-Z0-9][^\/\?.#]+/, :concerns=>:deployable}
                                         GET    /platforms/probes/:type/:platform_name(/:sub_platform_name)/probes/=(.:format)                    platforms/probes#edit {:platform_name=>/[A-Z0-9][^\/\?.#]+/, :sub_platform_name=>/[A-Z0-9][^\/\?.#]+/, :type=>/[A-Z0-9][^\/\?.#]+/, :concerns=>:deployable}
                                         GET    /platforms/probes/:type/:platform_name(/:sub_platform_name)/probes(.:format)                      platforms/probes#show {:platform_name=>/[A-Z0-9][^\/\?.#]+/, :sub_platform_name=>/[A-Z0-9][^\/\?.#]+/, :type=>/[A-Z0-9][^\/\?.#]+/, :concerns=>:deployable}
                                         PUT    /platforms/probes/:type/:platform_name(/:sub_platform_name)/probes(.:format)                      platforms/probes#update {:platform_name=>/[A-Z0-9][^\/\?.#]+/, :sub_platform_name=>/[A-Z0-9][^\/\?.#]+/, :type=>/[A-Z0-9][^\/\?.#]+/, :concerns=>:deployable}
                                         DELETE /platforms/probes/:type/:platform_name(/:sub_platform_name)/probes(.:format)                      platforms/probes#destroy {:platform_name=>/[A-Z0-9][^\/\?.#]+/, :sub_platform_name=>/[A-Z0-9][^\/\?.#]+/, :type=>/[A-Z0-9][^\/\?.#]+/, :concerns=>:deployable}
           edit_platforms_platform_probe GET    /platforms/probes/:type/:platform_name(/:sub_platform_name)/probes/:id/=(.:format)                platforms/probes#edit {:platform_name=>/[A-Z0-9][^\/\?.#]+/, :sub_platform_name=>/[A-Z0-9][^\/\?.#]+/, :type=>/[A-Z0-9][^\/\?.#]+/, :concerns=>:deployable}
                platforms_platform_probe GET    /platforms/probes/:type/:platform_name(/:sub_platform_name)/probes/:id(.:format)                  platforms/probes#show {:platform_name=>/[A-Z0-9][^\/\?.#]+/, :sub_platform_name=>/[A-Z0-9][^\/\?.#]+/, :type=>/[A-Z0-9][^\/\?.#]+/, :concerns=>:deployable}
                                         PUT    /platforms/probes/:type/:platform_name(/:sub_platform_name)/probes/:id(.:format)                  platforms/probes#update {:platform_name=>/[A-Z0-9][^\/\?.#]+/, :sub_platform_name=>/[A-Z0-9][^\/\?.#]+/, :type=>/[A-Z0-9][^\/\?.#]+/, :concerns=>:deployable}
                                         DELETE /platforms/probes/:type/:platform_name(/:sub_platform_name)/probes/:id(.:format)                  platforms/probes#destroy {:platform_name=>/[A-Z0-9][^\/\?.#]+/, :sub_platform_name=>/[A-Z0-9][^\/\?.#]+/, :type=>/[A-Z0-9][^\/\?.#]+/, :concerns=>:deployable}

(I know, my resources are a little strange, I'm currently optimizing them...that's why I came to routing concerns ;o) )

Everything works fine when I apply concern on every resource.

Thanks !

Same here, I have 2 resources that I need in several scopes.
Don't know what's the status of this on Rails4 ?

@porecrea You can pull from my fork if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment