app/controllers/knitkit/comments_controller.rb in knitkit-2.1.15 vs app/controllers/knitkit/comments_controller.rb in knitkit-3.0.0
- old
+ new
@@ -5,14 +5,19 @@
content = Content.find(params[:content_id])
comment = params[:comment]
@comment = content.add_comment({:commentor_name => user.party.description, :email => user.email, :comment => comment})
- render :text => (@comment.valid? ? '<div class="sexynotice">Comment pending approval.</div>' : '<div class="sexynotice">Error. Comment cannot be blank.</div>')
+ if @comment.valid?
+ render :json => {:success => true, :message => 'Comment pending approval'}
+ else
+ render :json => {:success => false, :message => 'Error. Comment cannot be blank'}
+ end
end
#no section to set
def set_section
- return false
+ false
end
+
end
end