<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -42,7 +42,7 @@ module ActionController
   #
   # Read more about REST at http://en.wikipedia.org/wiki/Representational_State_Transfer
   module Resources
-    INHERITABLE_OPTIONS = :namespace, :shallow, :actions
+    INHERITABLE_OPTIONS = :namespace, :shallow
 
     class Resource #:nodoc:
       DEFAULT_ACTIONS = :index, :create, :new, :edit, :show, :update, :destroy
@@ -119,7 +119,7 @@ module ActionController
       end
 
       def has_action?(action)
-        !DEFAULT_ACTIONS.include?(action) || @options[:actions].nil? || @options[:actions].include?(action)
+        !DEFAULT_ACTIONS.include?(action) || action_allowed?(action)
       end
 
       protected
@@ -135,24 +135,29 @@ module ActionController
         end
 
         def set_allowed_actions
-          only    = @options.delete(:only)
-          except  = @options.delete(:except)
+          only, except = @options.values_at(:only, :except)
+          @allowed_actions ||= {}
 
-          if only &amp;&amp; except
-            raise ArgumentError, 'Please supply either :only or :except, not both.'
-          elsif only == :all || except == :none
-            options[:actions] = DEFAULT_ACTIONS
+          if only == :all || except == :none
+            only = nil
+            except = []
           elsif only == :none || except == :all
-            options[:actions] = []
-          elsif only
-            options[:actions] = DEFAULT_ACTIONS &amp; Array(only).map(&amp;:to_sym)
+            only = []
+            except = nil
+          end
+
+          if only
+            @allowed_actions[:only] = Array(only).map(&amp;:to_sym)
           elsif except
-            options[:actions] = DEFAULT_ACTIONS - Array(except).map(&amp;:to_sym)
-          else
-            # leave options[:actions] alone
+            @allowed_actions[:except] = Array(except).map(&amp;:to_sym)
           end
         end
 
+        def action_allowed?(action)
+          only, except = @allowed_actions.values_at(:only, :except)
+          (!only || only.include?(action)) &amp;&amp; (!except || !except.include?(action))
+        end
+
         def set_prefixes
           @path_prefix = options.delete(:path_prefix)
           @name_prefix = options.delete(:name_prefix)
@@ -403,8 +408,6 @@ module ActionController
     #   # --&gt; POST /posts/1/comments (maps to the CommentsController#create action)
     #   # --&gt; PUT /posts/1/comments/1 (fails)
     #
-    # The &lt;tt&gt;:only&lt;/tt&gt; and &lt;tt&gt;:except&lt;/tt&gt; options are inherited by any nested resource(s).
-    #
     # If &lt;tt&gt;map.resources&lt;/tt&gt; is called with multiple resources, they all get the same options applied.
     #
     # Examples:</diff>
      <filename>actionpack/lib/action_controller/resources.rb</filename>
    </modified>
    <modified>
      <diff>@@ -942,19 +942,6 @@ class ResourcesTest &lt; ActionController::TestCase
     end
   end
 
-  def test_nested_resource_inherits_only_show_action
-    with_routing do |set|
-      set.draw do |map|
-        map.resources :products, :only =&gt; :show do |product|
-          product.resources :images
-        end
-      end
-
-      assert_resource_allowed_routes('images', { :product_id =&gt; '1' },                    { :id =&gt; '2' }, :show, [:index, :new, :create, :edit, :update, :destroy], 'products/1/images')
-      assert_resource_allowed_routes('images', { :product_id =&gt; '1', :format =&gt; 'xml' },  { :id =&gt; '2' }, :show, [:index, :new, :create, :edit, :update, :destroy], 'products/1/images')
-    end
-  end
-
   def test_nested_resource_has_only_show_and_member_action
     with_routing do |set|
       set.draw do |map|
@@ -971,7 +958,7 @@ class ResourcesTest &lt; ActionController::TestCase
     end
   end
 
-  def test_nested_resource_ignores_only_option
+  def test_nested_resource_does_not_inherit_only_option
     with_routing do |set|
       set.draw do |map|
         map.resources :products, :only =&gt; :show do |product|
@@ -984,7 +971,20 @@ class ResourcesTest &lt; ActionController::TestCase
     end
   end
 
-  def test_nested_resource_ignores_except_option
+  def test_nested_resource_does_not_inherit_only_option_by_default
+    with_routing do |set|
+      set.draw do |map|
+        map.resources :products, :only =&gt; :show do |product|
+          product.resources :images
+        end
+      end
+
+      assert_resource_allowed_routes('images', { :product_id =&gt; '1' },                    { :id =&gt; '2' }, [:index, :new, :create, :show, :edit, :update, :destory], [], 'products/1/images')
+      assert_resource_allowed_routes('images', { :product_id =&gt; '1', :format =&gt; 'xml' },  { :id =&gt; '2' }, [:index, :new, :create, :show, :edit, :update, :destroy], [], 'products/1/images')
+    end
+  end
+
+  def test_nested_resource_does_not_inherit_except_option
     with_routing do |set|
       set.draw do |map|
         map.resources :products, :except =&gt; :show do |product|
@@ -997,6 +997,19 @@ class ResourcesTest &lt; ActionController::TestCase
     end
   end
 
+  def test_nested_resource_does_not_inherit_except_option_by_default
+    with_routing do |set|
+      set.draw do |map|
+        map.resources :products, :except =&gt; :show do |product|
+          product.resources :images
+        end
+      end
+
+      assert_resource_allowed_routes('images', { :product_id =&gt; '1' },                    { :id =&gt; '2' }, [:index, :new, :create, :show, :edit, :update, :destroy], [], 'products/1/images')
+      assert_resource_allowed_routes('images', { :product_id =&gt; '1', :format =&gt; 'xml' },  { :id =&gt; '2' }, [:index, :new, :create, :show, :edit, :update, :destroy], [], 'products/1/images')
+    end
+  end
+
   def test_default_singleton_restful_route_uses_get
     with_routing do |set|
       set.draw do |map|</diff>
      <filename>actionpack/test/controller/resources_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ec8f04584479aff895b0b511a7ba1e9d33f84067</id>
    </parent>
  </parents>
  <author>
    <name>Tarmo T&#228;nav</name>
    <email>tarmo@itech.ee</email>
  </author>
  <url>http://github.com/rails/rails/commit/80747e9db16ec60eb0d95b510baf051612ec0768</url>
  <id>80747e9db16ec60eb0d95b510baf051612ec0768</id>
  <committed-date>2009-01-31T17:47:56-08:00</committed-date>
  <authored-date>2009-01-30T03:37:59-08:00</authored-date>
  <message>Removed map.resources :only/:except inheritance

It's very rare for these options to apply identically to nested child resources, and with this inheritance on it's very difficult to have a child resource with more actions than the parent.

This reverts commit 2ecec6052f7f290252a9fd9cc27ec804c7aad36c.

Signed-off-by: Michael Koziarski &lt;michael@koziarski.com&gt;

[#1826 state:committed]</message>
  <tree>062a879107363bb72d77633473fca803d4afaa47</tree>
  <committer>
    <name>Michael Koziarski</name>
    <email>michael@koziarski.com</email>
  </committer>
</commit>
