This commit is contained in:
albert
2011-06-29 12:47:40 -04:00
parent 4e19d98047
commit 5cf122c2e0
14 changed files with 96 additions and 76 deletions

View File

@@ -21,10 +21,7 @@ class CommentsController < ApplicationController
end
def create
@comment = Comment.new(params[:comment])
@comment.post_id = params[:comment][:post_id]
@comment.score = 0
@comment.save
@comment = Comment.create(params[:comment])
respond_with(@comment) do |format|
format.html do
redirect_to post_path(@comment.post), :notice => "Comment posted"