In a Controller, I'm trying to access a parameter which is deeply nested. Here is my parameter trace.
Parameters:
{"utf8"=>"✓",
"authenticity_token"=>"2j+Nh5C7jPkNOsQnWoA0wtG/vWxLMpyKt6aiC2UmxgY=",
"inventory"=>{"ingredients_attributes"=>{"0"=>{"ingredient_name"=>"Bread"}},
"purchase_date"=>"11",
"purchase_price"=>"11",
"quantity_bought"=>"11"},
"commit"=>"Create Inventory"}
I'm trying to retrieve "Bread" from this. I tried params[:inventory][:ingredient][:ingredient_name] and other variations. What is the correct styntax?
If it matters,
Inventory has_many :ingredients
Inventory accepts_nested_attributes_for :inventories
Thanks!