Skip to content
Browse files

Render markdown when updating comments.

  • Loading branch information...
1 parent 6ae8832 commit 6d4b557bd20671c6850035f9bbf7336ac95e9eab @mpereira mpereira committed Nov 23, 2011
Showing with 6 additions and 5 deletions.
  1. +6 −5 app/controllers/comments_controller.rb
View
11 app/controllers/comments_controller.rb
@@ -3,6 +3,9 @@ class CommentsController < ApplicationController
before_filter :find_scope
before_filter :check_permissions, :except => [:create]
+ # We need ApplicationHelper#markdown.
+ include ApplicationHelper
+
def create
track_bingo(:commented)
@@ -114,11 +117,9 @@ def update
render :json => @comment.to_json, :status => :ok
end
format.js do
- render :json => {
- :message => notice,
- :success => true,
- :body => @comment.body
- }
+ render(:json => { :success => true,
+ :message => notice,
+ :body => markdown(@comment.body) } )
end
else
error = @comment.errors.full_messages.join(", ")

0 comments on commit 6d4b557

Please sign in to comment.
Something went wrong with that request. Please try again.