<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -6,7 +6,6 @@ module Ardes #:nodoc:
         extend ClassMethods
         alias_method_chain :default_render, :response_for
         alias_method_chain :template_exists?, :response_for
-        alias_method_chain :respond_to, :response_for
       end
     end
     
@@ -119,25 +118,31 @@ module Ardes #:nodoc:
     end
     
   protected
-    # does a response exist for the current action?
-    def response_exists?
-      self.class.action_responses.keys.include?(action_name.to_s)
+    # return the responses defined by response_for for the current action
+    def action_responses
+      self.class.action_responses[action_name] || []
+    end
+    
+    # respond_to sets the content type on the response, so we use that to tell
+    # if respond_to has been performed
+    def respond_to_performed?
+      (response &amp;&amp; response.content_type) ? true : false
     end
     
     # we extend template_exists? to return true if a template OR a response exists corresponding to the current action.
     # This is so that a default render will be triggered when no action, but a repsonse does exist.
     def template_exists_with_response_for?
-      response_exists? || template_exists_without_response_for?
+      action_responses.any? || template_exists_without_response_for?
     end
 
-    # if there are responses for the current action, then respond_to them
+    # if the response.content_type has not been set (if it has, then responthere are responses for the current action, then respond_to them
     #
     # we rescue the case where there were no responses, so that the default_render
     # action will be performed
     def respond_to_action_responses
-      if !@respond_to_performed &amp;&amp; (responses = self.class.action_responses[action_name]) &amp;&amp; responses.any?
+      if !respond_to_performed? &amp;&amp; action_responses.any?
         respond_to do |responder|
-          responses.each {|response| instance_exec(responder, &amp;response) }
+          action_responses.each {|response| instance_exec(responder, &amp;response) }
         end rescue Responder::NoResponsesError
       end
     end
@@ -149,11 +154,6 @@ module Ardes #:nodoc:
       default_render_without_response_for unless performed?
     end
     
-    def respond_to_with_response_for(*args, &amp;block)
-      @respond_to_performed = true
-      respond_to_without_response_for(*args, &amp;block)
-    end
-    
     # included into ActionController::MimeResponds::Responder
     module Responder
       class NoResponsesError &lt; RuntimeError; end</diff>
      <filename>lib/ardes/response_for.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4d9e74e45897d221d72e547c903c20d22cdbca19</id>
    </parent>
  </parents>
  <author>
    <name>Ian White</name>
    <email>ian.w.white@gmail.com</email>
  </author>
  <url>http://github.com/ianwhite/response_for/commit/94749ff29a5b6103f1097aa97ab7a30ff4a69d8e</url>
  <id>94749ff29a5b6103f1097aa97ab7a30ff4a69d8e</id>
  <committed-date>2008-10-19T22:49:32-07:00</committed-date>
  <authored-date>2008-10-19T22:49:32-07:00</authored-date>
  <message>Removed uneccessary @respond_to_performed, and chain of respond_to, which means that erase_render_results will just work without any tinkering</message>
  <tree>55e5d0208227f9a442a21693d67850ad46171a07</tree>
  <committer>
    <name>Ian White</name>
    <email>ian.w.white@gmail.com</email>
  </committer>
</commit>
