Last active
February 19, 2016 12:09
-
-
Save sunny4381/84d845d5ca97a5920c85 to your computer and use it in GitHub Desktop.
Strong Parameter で Unpermitted parameters と表示された時の Rails Console での検証方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails Console で次のコマンドを試す | |
```ruby | |
very_complicated_post = { | |
"item" => { | |
"point"=>{ | |
"loc"=>{ | |
"lng"=>"138.08578491210937", | |
"lat"=>"36.24584590837756"}, | |
"zoom_level"=>"10" } } } | |
params = ActionController::Parameters.new(very_complicated_post) | |
params.require(:item).permit(point: [ :zoom_level, { loc: [ :lat, :lng ] } ]) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment