summaryrefslogtreecommitdiff
path: root/app/controllers/comments_controller.rb
diff options
context:
space:
mode:
authormo k <mo@mokhan.ca>2012-06-08 19:04:20 -0600
committermo k <mo@mokhan.ca>2012-06-08 19:04:20 -0600
commitc093f68ba91f87fef80f7189c9efc1039929388f (patch)
tree225feafb8249a1eae2346aa683699d3626aea871 /app/controllers/comments_controller.rb
parent819e29cbc23972071a8d444b9e7e348a90ae799d (diff)
fix bug where all comments were submitted as user with id 1
Diffstat (limited to 'app/controllers/comments_controller.rb')
-rw-r--r--app/controllers/comments_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb
index b1e2b7fe..4848c972 100644
--- a/app/controllers/comments_controller.rb
+++ b/app/controllers/comments_controller.rb
@@ -7,8 +7,9 @@ class CommentsController < ApplicationController
def create
creation = Creation.find(params[:creation_id])
- comment = Comment.build_from(creation, current_user, params[:comment][:body])
+ comment = Comment.build_from(creation, current_user.id, params[:comment][:body])
if comment.save
+ flash[:notice] = "Your comment was added!"
redirect_to creation_path(creation)
else
flash[:error] = "Ooops... we couldn't save your comment at this time."