Permalink
Browse files

Fix undefined method error for NilClass

Add .try to prevent undefined method error for NilClass.
  • Loading branch information...
serracorwin committed Oct 23, 2013
1 parent 1dc9e1c commit 872b3c91b3d6bd5b418463cb92ecc05bce39649d
Showing with 1 addition and 1 deletion.
  1. +1 −1 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
```

0 comments on commit 872b3c9

Please sign in to comment.