query for post through user

This commit is contained in:
danielvincent 2010-09-23 10:17:13 -07:00
parent f11a481ed7
commit c000b31ffb

View file

@ -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