diff options
Diffstat (limited to 'actionpack/lib/action_controller/resources.rb')
-rw-r--r-- | actionpack/lib/action_controller/resources.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/resources.rb b/actionpack/lib/action_controller/resources.rb index 1cfb7c11d0..3cb9367fc2 100644 --- a/actionpack/lib/action_controller/resources.rb +++ b/actionpack/lib/action_controller/resources.rb @@ -295,7 +295,7 @@ module ActionController # HTTP POST on <tt>new_message_url</tt> will raise a RoutingError exception. The default route in # <tt>config/routes.rb</tt> overrides this and allows invalid HTTP methods for resource routes. def resources(*entities, &block) - options = entities.last.is_a?(Hash) ? entities.pop : { } + options = entities.extract_options! entities.each { |entity| map_resource(entity, options.dup, &block) } end @@ -369,7 +369,7 @@ module ActionController # edit_account edit_account_url, hash_for_edit_account_url, # edit_account_path, hash_for_edit_account_path def resource(*entities, &block) - options = entities.last.is_a?(Hash) ? entities.pop : { } + options = entities.extract_options! entities.each { |entity| map_singleton_resource(entity, options.dup, &block) } end |