<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -631,10 +631,18 @@ module Hobo
       self.this = @creator.run!(current_user, attribute_parameters)
       response_block(&amp;b) or
         if valid?
-          redirect_after_submit options
+          respond_to do |wants|
+            wants.html { redirect_after_submit(options) }
+            wants.js   { hobo_ajax_response || render(:nothing =&gt; true) }
+          end
         else
           this.exempt_from_edit_checks = true
-          re_render_form(name)
+          respond_to do |wants|
+            wants.html { re_render_form(name) }
+            wants.js   { render(:status =&gt; 500,
+                                :text =&gt; (&quot;Couldn't do creator #{name}.\n&quot; +
+                                          this.errors.full_messages.join(&quot;\n&quot;))) }
+          end
         end
     end
 
@@ -663,9 +671,17 @@ module Hobo
       @transition.run!(this, current_user, attribute_parameters)
       response_block(&amp;b) or
         if valid?
-          redirect_after_submit options
+          respond_to do |wants|
+            wants.html { redirect_after_submit(options) }
+            wants.js   { hobo_ajax_response || render(:nothing =&gt; true) }
+          end
         else
-          re_render_form(name)
+          respond_to do |wants|
+            wants.html { re_render_form(name) }
+            wants.js   { render(:status =&gt; 500,
+                                :text =&gt; (&quot;Couldn't do transition #{name}.\n&quot; +
+                                          this.errors.full_messages.join(&quot;\n&quot;))) }
+          end
         end
     end
 </diff>
      <filename>hobo/lib/hobo/model_controller.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>acd572da25598fe1cb989db0faa3ad82b5d67159</id>
    </parent>
  </parents>
  <author>
    <name>Bryan Larsen</name>
    <email>blarsen@btp.(none)</email>
  </author>
  <url>http://github.com/tablatom/hobo/commit/3802f6e3dc459cd17d318e320a439febaffae8bf</url>
  <id>3802f6e3dc459cd17d318e320a439febaffae8bf</id>
  <committed-date>2009-06-08T07:41:32-07:00</committed-date>
  <authored-date>2009-06-08T07:41:32-07:00</authored-date>
  <message>Bug 431: Ajax forms for lifecycle actions don't work.</message>
  <tree>127bf08be64444af3cbaa5c16342baf9b268b28b</tree>
  <committer>
    <name>Bryan Larsen</name>
    <email>blarsen@btp.(none)</email>
  </committer>
</commit>
