20 lines
402 B
Ruby
20 lines
402 B
Ruby
class Public::CommentsController < ApplicationController
|
|
|
|
def create
|
|
@comment = Comment.new(params.require(:comment).permit(:website, :pseudo, :email, :comment, :commentable_id, :commentable_type))
|
|
|
|
@comment.enabled = true
|
|
|
|
|
|
if @comment.save
|
|
commentable = @comment.commentable
|
|
@comment_id = @comment.id
|
|
@comment = Comment.new
|
|
@comment.commentable = commentable
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|