diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index cc601e87f..1a2a283dc 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -15,7 +15,7 @@ class CommentsController < ApplicationController end def create - target = current_user.find_visible_shareable_by_id Post, params[:post_id] + target = current_user.find_visible_shareable_by_id(Post, params[:post_id]) text = params[:text] if target @@ -24,7 +24,7 @@ class CommentsController < ApplicationController if @comment.save Rails.logger.info("event => :create, :type => :comment, :user => #{current_user.diaspora_handle}, :status => :success, :comment => #{@comment.id}, :chars => #{params[:text].length}") - Postzord::Dispatcher.build(current_user, @comment).post + current_user.dispatch_post(@comment) respond_to do |format| format.json{ render :json => @comment.as_api_response(:backbone), :status => 201 } @@ -51,8 +51,7 @@ class CommentsController < ApplicationController else respond_to do |format| format.mobile {redirect_to :back} - format.js {render :nothing => true, :status => 403} - format.json { render :nothing => true, :status => 403 } + format.any(:js, :json) {render :nothing => true, :status => 403} end end end