From 04823ff48fbde3ecf7849a1e1a3d3bcc4cc71aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=BCtke?= Date: Thu, 17 May 2007 01:27:54 +0000 Subject: Allow nested namespaces in routing git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6748 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/resources.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/resources.rb b/actionpack/lib/action_controller/resources.rb index a8373677fd..df0c64d91c 100644 --- a/actionpack/lib/action_controller/resources.rb +++ b/actionpack/lib/action_controller/resources.rb @@ -351,7 +351,11 @@ module ActionController # It'll also create admin_product_tags_url pointing to "admin/products/#{product_id}/tags", which will look for # Admin::TagsController. def namespace(name, options = {}, &block) - with_options({ :path_prefix => name, :name_prefix => "#{name}_", :namespace => "#{name}/" }.merge(options), &block) + if options[:namespace] + with_options({:path_prefix => "#{options.delete(:path_prefix)}/#{name}", :name_prefix => "#{options.delete(:name_prefix)}#{name}_", :namespace => "#{options.delete(:namespace)}#{name}/" }.merge(options), &block) + else + with_options({ :path_prefix => name.to_s, :name_prefix => "#{name}_", :namespace => "#{name}/" }.merge(options), &block) + end end -- cgit v1.2.3