aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorcorwinkelly <corwin.rebma@gmail.com>2013-10-22 16:11:56 -0400
committercorwinkelly <corwin.rebma@gmail.com>2013-10-22 16:11:56 -0400
commit1dc9e1ce7f7e51491ce186b7da2965951d73307d (patch)
treed5b96431d71599dd62ca5e56f852a8947cf1a0dc /guides
parentf230dbf6990fe4d2b7d33ef2caa3715a33bc0328 (diff)
downloadrails-1dc9e1ce7f7e51491ce186b7da2965951d73307d.tar.gz
rails-1dc9e1ce7f7e51491ce186b7da2965951d73307d.tar.bz2
rails-1dc9e1ce7f7e51491ce186b7da2965951d73307d.zip
Update workaround for "Outside the Scope of Strong Parameters"
The previous example of how to permit a hash of unknown keys used .tap, but had the side effect of logging an "Unpermitted parameters" message despite being a successful workaround. The proposed workaround is ever so slightly better, imo, because it won't result in an "Unpermitted parameters" message being logged.
Diffstat (limited to 'guides')
-rw-r--r--guides/source/action_controller_overview.md4
1 files changed, 1 insertions, 3 deletions
diff --git a/guides/source/action_controller_overview.md b/guides/source/action_controller_overview.md
index cd4a1a0792..3d8e438b3a 100644
--- a/guides/source/action_controller_overview.md
+++ b/guides/source/action_controller_overview.md
@@ -328,9 +328,7 @@ the job done:
```ruby
def product_params
- params.require(:product).permit(:name).tap do |whitelisted|
- whitelisted[:data] = params[:product][:data]
- end
+ params.require(:product).permit(:name, { data: params[:product][:data].keys })
end
```