query for post through user
This commit is contained in:
parent
f11a481ed7
commit
c000b31ffb
1 changed files with 1 additions and 1 deletions
|
|
@ -10,7 +10,7 @@ class CommentsController < ApplicationController
|
|||
respond_to :json, :only => :show
|
||||
|
||||
def create
|
||||
target = Post.find_by_id params[:comment][:post_id]
|
||||
target = current_user.find_visible_post_by_id params[:comment][:post_id]
|
||||
text = params[:comment][:text]
|
||||
|
||||
@comment = current_user.comment text, :on => target
|
||||
|
|
|
|||
Loading…
Reference in a new issue