sql injection prevention for create method in rails controller

前端 未结 2 887
既然无缘
既然无缘 2021-01-18 03:39

As seen in comment_controller.rb:

def create
    @comment = Comment.new(params[:comment])
    @comment.save
end

Im assuming that this is SQ

2条回答
  •  情书的邮戳
    2021-01-18 04:28

    Note that your code example is safe from SQL injection as explained by Alex, but it's not safe from mass assignment exploits.

提交回复
热议问题