From db6ce8de4ca1ec6b70dafbcc703ce67db022c382 Mon Sep 17 00:00:00 2001 From: Dylan Clark Date: Thu, 27 Feb 2020 17:28:37 -0800 Subject: [PATCH] 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] --- guides/source/action_controller_overview.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guides/source/action_controller_overview.md b/guides/source/action_controller_overview.md index 767581dee6..4481acd10f 100644 --- a/guides/source/action_controller_overview.md +++ b/guides/source/action_controller_overview.md @@ -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]