aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/resources.rb
diff options
context:
space:
mode:
authorTobias Lütke <tobias.luetke@gmail.com>2007-05-19 16:26:44 +0000
committerTobias Lütke <tobias.luetke@gmail.com>2007-05-19 16:26:44 +0000
commit10085359058f8b04a061eed1d2c1e44971ae4303 (patch)
treea23d7b506dcdf4d5d354de0a8410581c7b7b0afe /actionpack/lib/action_controller/resources.rb
parenta995b9cde074bec46ab4befc53f16ff91ec952f2 (diff)
downloadrails-10085359058f8b04a061eed1d2c1e44971ae4303.tar.gz
rails-10085359058f8b04a061eed1d2c1e44971ae4303.tar.bz2
rails-10085359058f8b04a061eed1d2c1e44971ae4303.zip
Allow routes to be declared off namespaces
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6783 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/resources.rb')
-rw-r--r--actionpack/lib/action_controller/resources.rb20
1 files changed, 0 insertions, 20 deletions
diff --git a/actionpack/lib/action_controller/resources.rb b/actionpack/lib/action_controller/resources.rb
index df0c64d91c..bb92684e5c 100644
--- a/actionpack/lib/action_controller/resources.rb
+++ b/actionpack/lib/action_controller/resources.rb
@@ -339,26 +339,6 @@ module ActionController
entities.each { |entity| map_singleton_resource(entity, options.dup, &block) }
end
- # Enables the use of resources in a module by setting the name_prefix, path_prefix, and namespace for the model.
- # Example:
- #
- # map.namespace(:admin) do |admin|
- # admin.resources :products,
- # :has_many => [ :tags, :images, :variants ]
- # end
- #
- # This will create admin_products_url pointing to "admin/products", which will look for an Admin::ProductsController.
- # 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)
- 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
-
-
private
def map_resource(entities, options = {}, &block)
resource = Resource.new(entities, options)