<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -13,11 +13,13 @@ configure do
 end
 
 helpers do
-  def cleanup(post)
-    post.rendered = RedCloth.new(post.body).to_html
-    post.tags_list = post.tags_list.gsub(/ /, &quot;&quot;).downcase
-    post.tags = post.tags_list.split(&quot;,&quot;)
-    post.save!
+  def cleanup(obj)
+    obj.rendered = RedCloth.new(obj.body).to_html
+    if obj.is_a?(Post)
+      obj.tags_list = obj.tags_list.gsub(/ /, &quot;&quot;).downcase
+      obj.tags = obj.tags_list.split(&quot;,&quot;)
+    end
+    obj.save!
   end
 end
 
@@ -62,6 +64,7 @@ put '/posts/:id' do
 end
 
 post '/posts/:post_id/comments' do
-  Comment.create(params)
+  @comment = Comment.create(params)
+  cleanup @comment
   redirect &quot;/posts/#{params[:post_id]}&quot;
 end
\ No newline at end of file</diff>
      <filename>app.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@ class Comment
   
   key :author, String
   key :body, String
+  key :rendered, String
   timestamps!
 
   belongs_to :post</diff>
      <filename>models/comment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,7 @@
       =comment.author
       said
       %br/
-      =comment.body
+      =comment.rendered
 %form{:action =&gt; &quot;/posts/#{@post.id}/comments&quot;, :method =&gt; 'post'}
   %p
     %label{:for =&gt; 'author'}Author:</diff>
      <filename>views/posts/show.haml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cbef2e6bfc1ffd8a90de904552232ddaca2f8cd1</id>
    </parent>
  </parents>
  <author>
    <name>Will Farrington</name>
    <email>will@railsmachine.com</email>
  </author>
  <url>http://github.com/skalnik/mango/commit/0c496e462d50664bde1f9b853b56abd701565f17</url>
  <id>0c496e462d50664bde1f9b853b56abd701565f17</id>
  <committed-date>2009-10-25T18:46:03-07:00</committed-date>
  <authored-date>2009-10-25T18:46:03-07:00</authored-date>
  <message>Add RedCloth rendering to comments.</message>
  <tree>04850c9ee11fcc99fe2a7fbb9f4a2df3559cf2dc</tree>
  <committer>
    <name>Will Farrington</name>
    <email>will@railsmachine.com</email>
  </committer>
</commit>
