<?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, :only, :except
+    INHERITABLE_OPTIONS = :namespace, :shallow, :actions
 
     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) || action_allowed?(action)
+        !DEFAULT_ACTIONS.include?(action) || @options[:actions].nil? || @options[:actions].include?(action)
       end
 
       protected
@@ -135,29 +135,24 @@ module ActionController
         end
 
         def set_allowed_actions
-          only, except = @options.values_at(:only, :except)
-          @allowed_actions ||= {}
+          only    = @options.delete(:only)
+          except  = @options.delete(:except)
 
-          if only == :all || except == :none
-            only = nil
-            except = []
+          if only &amp;&amp; except
+            raise ArgumentError, 'Please supply either :only or :except, not both.'
+          elsif only == :all || except == :none
+            options[:actions] = DEFAULT_ACTIONS
           elsif only == :none || except == :all
-            only = []
-            except = nil
-          end
-
-          if only
-            @allowed_actions[:only] = Array(only).map(&amp;:to_sym)
+            options[:actions] = []
+          elsif only
+            options[:actions] = DEFAULT_ACTIONS &amp; Array(only).map(&amp;:to_sym)
           elsif except
-            @allowed_actions[:except] = Array(except).map(&amp;:to_sym)
+            options[:actions] = DEFAULT_ACTIONS - Array(except).map(&amp;:to_sym)
+          else
+            # leave options[:actions] alone
           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)</diff>
      <filename>actionpack/lib/action_controller/resources.rb</filename>
    </modified>
    <modified>
      <diff>@@ -971,6 +971,32 @@ class ResourcesTest &lt; Test::Unit::TestCase
     end
   end
 
+  def test_nested_resource_ignores_only_option
+    with_routing do |set|
+      set.draw do |map|
+        map.resources :products, :only =&gt; :show do |product|
+          product.resources :images, :except =&gt; :destroy
+        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_nested_resource_ignores_except_option
+    with_routing do |set|
+      set.draw do |map|
+        map.resources :products, :except =&gt; :show do |product|
+          product.resources :images, :only =&gt; :destroy
+        end
+      end
+
+      assert_resource_allowed_routes('images', { :product_id =&gt; '1' },                    { :id =&gt; '2' }, :destroy, [:index, :new, :create, :show, :edit, :update], 'products/1/images')
+      assert_resource_allowed_routes('images', { :product_id =&gt; '1', :format =&gt; 'xml' },  { :id =&gt; '2' }, :destroy, [:index, :new, :create, :show, :edit, :update], 'products/1/images')
+    end
+  end
+
   protected
     def with_restful_routing(*args)
       with_routing do |set|</diff>
      <filename>actionpack/test/controller/resources_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>94d6716324126028b89dde886f160474049b1b0c</id>
    </parent>
  </parents>
  <author>
    <name>Tom Stuart</name>
    <login>tomstuart</login>
    <email>tom@experthuman.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/2ecec6052f7f290252a9fd9cc27ec804c7aad36c</url>
  <id>2ecec6052f7f290252a9fd9cc27ec804c7aad36c</id>
  <committed-date>2008-11-14T03:26:43-08:00</committed-date>
  <authored-date>2008-11-13T12:00:11-08:00</authored-date>
  <message>Make inheritance of map.resources :only/:except options behave more predictably

Signed-off-by: Michael Koziarski &lt;michael@koziarski.com&gt;</message>
  <tree>4a692a5e956f72e32fe8e48686c4d99abdd3c89b</tree>
  <committer>
    <name>Michael Koziarski</name>
    <login>NZKoz</login>
    <email>michael@koziarski.com</email>
  </committer>
</commit>
