未验证 提交 6020bf32 编写于 作者: R Rafael França 提交者: GitHub

Merge pull request #38595 from dylnclrk/update-params-in-docs

Update code snippets to suggest the use of strong parameters
......@@ -543,7 +543,7 @@ By default, adding values to the flash will make them available to the next requ
```ruby
class ClientsController < ApplicationController
def create
@client = Client.new(params[:client])
@client = Client.new(client_params)
if @client.save
# ...
else
......@@ -567,7 +567,7 @@ class CommentsController < ApplicationController
end
def create
@comment = Comment.new(params[:comment])
@comment = Comment.new(comment_params)
if @comment.save
flash[:notice] = "Thanks for your comment!"
if params[:remember_name]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册