mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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:
parent
5f596e299e
commit
db6ce8de4c
1 changed files with 2 additions and 2 deletions
|
@ -543,7 +543,7 @@ By default, adding values to the flash will make them available to the next requ
|
||||||
```ruby
|
```ruby
|
||||||
class ClientsController < ApplicationController
|
class ClientsController < ApplicationController
|
||||||
def create
|
def create
|
||||||
@client = Client.new(params[:client])
|
@client = Client.new(client_params)
|
||||||
if @client.save
|
if @client.save
|
||||||
# ...
|
# ...
|
||||||
else
|
else
|
||||||
|
@ -567,7 +567,7 @@ class CommentsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@comment = Comment.new(params[:comment])
|
@comment = Comment.new(comment_params)
|
||||||
if @comment.save
|
if @comment.save
|
||||||
flash[:notice] = "Thanks for your comment!"
|
flash[:notice] = "Thanks for your comment!"
|
||||||
if params[:remember_name]
|
if params[:remember_name]
|
||||||
|
|
Loading…
Reference in a new issue