aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/resources.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-08-01 00:29:02 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-08-01 00:29:02 +0000
commita247d72139f918e38c129d31572167db5170ee5d (patch)
tree6365799015caf2a17978b0a4b9a94e9876f8df21 /actionpack/lib/action_controller/resources.rb
parent78e37f45c64838b120699317068cf1950277897c (diff)
downloadrails-a247d72139f918e38c129d31572167db5170ee5d.tar.gz
rails-a247d72139f918e38c129d31572167db5170ee5d.tar.bz2
rails-a247d72139f918e38c129d31572167db5170ee5d.zip
Nesting map.resources
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4642 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/resources.rb')
-rw-r--r--actionpack/lib/action_controller/resources.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/resources.rb b/actionpack/lib/action_controller/resources.rb
index 2b4c9217d5..638052a2aa 100644
--- a/actionpack/lib/action_controller/resources.rb
+++ b/actionpack/lib/action_controller/resources.rb
@@ -69,15 +69,15 @@ module ActionController
end
end
- def resources(*entities)
+ def resources(*entities, &block)
options = entities.last.is_a?(Hash) ? entities.pop : { }
- entities.each { |entity| map_resource(entity, options.dup) { yield if block_given? } }
+ entities.each { |entity| map_resource entity, options.dup, &block }
end
private
def map_resource(entities, options = {}, &block)
resource = Resource.new(entities, options)
-
+
with_options :controller => resource.controller do |map|
map_collection_actions(map, resource)
map_new_actions(map, resource)
@@ -154,4 +154,4 @@ module ActionController
end
end
-ActionController::Routing::RouteSet::Mapper.send :include, ActionController::Resources \ No newline at end of file
+ActionController::Routing::RouteSet::Mapper.send :include, ActionController::Resources