<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,18 +1,9 @@
-* response_for only kicks in once ActionController has got to the stage of
-  performing an action.
-  
-    before_filter :bail_out
-  
-    def bail_out
-      respond_to do |format|
-        format.html { redirect_to :bail_out_place }
-      end
-    end
-  
-  The above code snippet bails out whatever the response_for, which I think is
-  the least surprising behaviour.
-  
-  (This means that you can ignore the last changelog message for response_for,
-  which has been deleted to avoid confusion)
+* now intercepting template_exists? to decide whether to render a response for an action
+  that has no action method defined.  (Removes somewhat mysterious behaviour of empty
+  actions being defined)
+
+* tagged v0.2.0 - API change, and major internal simplifications - see http://blog.ardes.com/response_for
+
+* tagged v0.1.0
   
 * initial release of response_for
\ No newline at end of file</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -165,6 +165,6 @@ StackingResponsesSpec::TheController with responses conditionally executed GET :
 - should redirect from second response
 - should NOT execute first html response
 
-Finished in 0.494693 seconds
+Finished in 0.49728 seconds
 
 92 examples, 0 failures</diff>
      <filename>SPECDOC</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,7 @@ module Ardes #:nodoc:
       base.class_eval do
         extend ClassMethods
         alias_method_chain :default_render, :response_for
+        alias_method_chain :template_exists?, :response_for
       end
     end
     
@@ -55,7 +56,7 @@ module Ardes #:nodoc:
       #
       #   response_for :update do |format|          # this example is for a resources_controller controller
       #     if !(resource.new_record? || resource.changed?) # =&gt; resource.saved?
-      #       format.js { render(:update) {|page| page.replace(dom_id(resource), :partial =&gt; resource}}
+      #       format.js { render(:update) {|page| page.replace dom_id(resource), :partial =&gt; resource }}
       #     else
       #       format.js { render(:update) {|page| page.visual_effect :shake, dom_id(resource) }}
       #     end
@@ -63,13 +64,13 @@ module Ardes #:nodoc:
       #
       # === Notes
       #
-      # * If the before_filters or action renders or redirects, then response_for will not be invoked
+      # * If the before_filters or action renders or redirects, then response_for will not be invoked.
       # * you can stack up multiple response_for calls, the most recent has precedence
       # * the specifed block is executed within the controller instance, so you can use controller
       #   instance methods and instance variables (i.e. you can make it look just like a regular
-      #   respond_to block)
-      # * you can add a response_for an action that is just a public template (where there is no
-      #   actual action method defined)
+      #   respond_to block).
+      # * you can add a response_for an action that has no action method defined.  This is just like
+      #   defining a template for an action that has no action method defined.
       # * you can combine the :types option with a block, the block has precedence if you specify the
       #   same mime type in both.
       def response_for(*actions, &amp;block)
@@ -84,10 +85,6 @@ module Ardes #:nodoc:
           action_responses[action] ||= []
           action_responses[action].unshift types_block if types_block
           action_responses[action].unshift block if block
-          
-          # if there's no action yet defined, create an empty one - this is so that you
-          # we may provide responses for templates
-          class_eval &quot;def #{action}; end&quot; unless instance_methods.include?(action)
         end
       end
     
@@ -113,6 +110,17 @@ 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)
+    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?
+    end
+
     # if there are responses for the current action, then respond_to them
     #
     # we rescue the case where there were no responses, so that the default_render</diff>
      <filename>lib/ardes/response_for.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b655450bed1f1b294f67a84ddb1e1faf440331bb</id>
    </parent>
  </parents>
  <author>
    <name>Ian White</name>
    <email>ian.w.white@gmail.com</email>
  </author>
  <url>http://github.com/ianwhite/response_for/commit/c89bc63b42f91ffcb06b34c6e9764b00e29e7979</url>
  <id>c89bc63b42f91ffcb06b34c6e9764b00e29e7979</id>
  <committed-date>2008-10-09T17:05:15-07:00</committed-date>
  <authored-date>2008-10-09T17:05:15-07:00</authored-date>
  <message>now intercepting template_exists? to decide whether to render a response for an action
  that has no action method defined.  (Removes somewhat mysterious behaviour of empty
  actions being defined)</message>
  <tree>991b6657d06f57d2c7fbc958bb3d7ef1ba03dcf1</tree>
  <committer>
    <name>Ian White</name>
    <email>ian.w.white@gmail.com</email>
  </committer>
</commit>
