Skip to content

Instantly share code, notes, and snippets.

@iamvery
Created May 2, 2014 13:25
Show Gist options
  • Save iamvery/11474860 to your computer and use it in GitHub Desktop.
Save iamvery/11474860 to your computer and use it in GitHub Desktop.
[4] pry(#<HighVoltage::PagesController>)> params
=> {"things"=>{"stuff"=>"123"},
"id"=>"landing_page",
"controller"=>"high_voltage/pages",
"action"=>"show"}
[5] pry(#<HighVoltage::PagesController>)> params.fetch(:stuff){ Hash.new }
=> {}
[6] pry(#<HighVoltage::PagesController>)> params
=> {"things"=>{"stuff"=>"123"},
"id"=>"landing_page",
"controller"=>"high_voltage/pages",
"action"=>"show",
"stuff"=>{}}
[7] pry(#<HighVoltage::PagesController>)>
@iamvery
Copy link
Author

iamvery commented May 2, 2014

Strange that fetch changes the params object by inserting stuff ಠ_ಠ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment