pic_vert_app/app/controllers/public/comments_controller.rb
2014-12-09 00:24:43 +01:00

20 lines
379 B
Ruby

class Public::CommentsController < ApplicationController
def create
@comment = Comment.new(params.require(:comment).permit(:website, :pseudo, :email, :comment, :commentable_id, :commentable_type))
if @comment.save
commentable = @comment.commentable
@comment_id = @comment.id
@comment = Comment.new
@comment.commentable = commentable
end
end
end