diff options
author | corwinkelly <corwin.rebma@gmail.com> | 2013-10-23 07:47:15 -0400 |
---|---|---|
committer | corwinkelly <corwin.rebma@gmail.com> | 2013-10-23 07:47:15 -0400 |
commit | 872b3c91b3d6bd5b418463cb92ecc05bce39649d (patch) | |
tree | 28c1d4898f272d7860b0a8317b681efe97ee98e4 /guides/source | |
parent | 1dc9e1ce7f7e51491ce186b7da2965951d73307d (diff) | |
download | rails-872b3c91b3d6bd5b418463cb92ecc05bce39649d.tar.gz rails-872b3c91b3d6bd5b418463cb92ecc05bce39649d.tar.bz2 rails-872b3c91b3d6bd5b418463cb92ecc05bce39649d.zip |
Fix undefined method error for NilClass
Add .try to prevent undefined method error for NilClass.
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/action_controller_overview.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/source/action_controller_overview.md b/guides/source/action_controller_overview.md index 3d8e438b3a..82a23b3dc0 100644 --- a/guides/source/action_controller_overview.md +++ b/guides/source/action_controller_overview.md @@ -328,7 +328,7 @@ the job done: ```ruby def product_params - params.require(:product).permit(:name, { data: params[:product][:data].keys }) + params.require(:product).permit(:name, { data: params[:product][:data].try(:keys) }) end ``` |