Commit c093f68b

mo k <mo@mokhan.ca>
2012-06-09 01:04:20
fix bug where all comments were submitted as user with id 1
1 parent 819e29c
Changed files (1)
app
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."