Browse files

Add README section about using #permit!

Readme possibility for bullet point 2 on gh-107
  • Loading branch information...
1 parent 756eadf commit 7b2d21cfea857b3298b45c5e195290629babe017 @bemurphy bemurphy committed Feb 27, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 README.rdoc
6 README.rdoc
@@ -43,6 +43,12 @@ To declare that the value in +params+ must be an array of permitted scalar value
params.permit(:id => [])
+To whitelist an entire hash of parameters, the +permit!+ method can be used
+ params.require(:log_entry).permit!
+This will mark the +:log_entry+ parameters hash and any subhash of it permitted. Extreme care should be taken when using +permit!+ as it will allow all current and future model attributes to be mass-assigned.
== Nested Parameters
You can also use permit on nested parameters, like:

0 comments on commit 7b2d21c

Please sign in to comment.