Live Comment System(AJAX powered)

by TechnWebSolution
Live Comment System(AJAX powered)

def create\\n @comment = Comment.new(comments_params)\\n @comment.user_id = current_user.id\\n @comment.post_id = @post.id\\n if @comment.save\\n respond_to do |format|\\n format.html{redirect_to :back}\\n format.js{}\\n end\\n end\\n end\\n\\n def destroy\\n @comment = Comment.find(params[:id])\\n if @comment.user_id = current_user.id\\n @comment.destroy\\n respond_to do |format|\\n format.html{}\\n format.js{}\\n end\\n else\\n redirect_to :back,flash[:alert]=\\\"Unauthorized action\\\"\\n end\\n end\\n\\n private\\n def comments_params\\n params.require(:comment).permit(:content)\\n end\\n\\n def set_post\\n @post = Post.find(params[:post_id])\\n end

image of username TechnWebSolution Flag of India Mohali, India

About Me

technsolution is a premier Information Technology company providing web enabled and software services to wide variety of client base across North America, Europe, Australia, and India. technSolution specializes in the arena of Website Designing, Web development, Software Development, and Web Promotion.

$10 USD/hr

NEW FREELANCER!

Tags