blog_perso_app/app/controllers/public/comments_controller.rb
Nicolas Bally ef2a73636b initial 2
2015-02-24 23:47:26 +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