Remove ForbiddenAttributesError from examples

Examples for flash and session had code that would generally
raise ForbiddenAttributesErrors. Tweak the examples to avoid
this potentially misleading example. [ci skip]
This commit is contained in:
Dylan Clark 2020-02-27 17:28:37 -08:00
parent 5f596e299e
commit db6ce8de4c
1 changed files with 2 additions and 2 deletions

View File

@ -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]