Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix undefined method error for NilClass

Add .try to prevent undefined method error for NilClass.
  • Loading branch information...
commit 872b3c91b3d6bd5b418463cb92ecc05bce39649d 1 parent 1dc9e1c
@corwinkelly corwinkelly authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  guides/source/action_controller_overview.md
View
2  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
```
Please sign in to comment.
Something went wrong with that request. Please try again.