Wrap text
Report abuse
why won't this damned thing updated my user's replied attribute to 1?
|
|
def create
@post = Post.find(params[:post_id])
@comment = @post.comments.build(params[:comment])
@comment.user_id = logged_in_user.id
if params[:reply_id]
@reply = Comment.find_by_id(params[:reply_id])
@comment.parent_id = params[:reply_id]
@comment.replier = @reply.user_id
@user = User.find(@reply.user_id)
@user.update_attributes(:replied => 1)
end
respond_to do |format|
if @comment.save
format.js
else
format.js { redirect_to post_path(@post)}
end
end
end
|