diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2012-10-12 00:50:20 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2012-10-12 01:01:26 -0200 |
commit | bdd105d8b91c5d0881ab78e36a65a79fdca4a7fb (patch) | |
tree | 4a4057eccbf31f3231a5ebc593c04ea69a68fdf9 /actionpack/test/controller/request | |
parent | b91a90e49606719a65fecd7c9d703f45df7b7f73 (diff) | |
download | rails-bdd105d8b91c5d0881ab78e36a65a79fdca4a7fb.tar.gz rails-bdd105d8b91c5d0881ab78e36a65a79fdca4a7fb.tar.bz2 rails-bdd105d8b91c5d0881ab78e36a65a79fdca4a7fb.zip |
When executing permit with just a key that points to a hash, DO NOT allow all the hash
params.require(:person).permit(:projects_attributes) was returning
=> {"projects_attributes"=>{"0"=>{"name"=>"Project 1"}}}
When should return
=> {}
You should be doing ...
params.require(:person).permit(projects_attributes: :name)
to get just the projects attributes you want to allow
Diffstat (limited to 'actionpack/test/controller/request')
0 files changed, 0 insertions, 0 deletions