Commit c093f68b
Changed files (1)
app
controllers
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."