Here’s a request string which has a value I want to pull out from the
category array - parent_id.
Parameters: {“category”=>{“name”=>“Condiments”, “parent_id”=>“1”},
“commit”=>“Create”}
How do I reference that subelement in the receiving script? I’ve tried
params[:parent_id]
params[:category[:parent_id]]
both unsuccessfully. I told you this was a stupid question. So how do
I
get at those values?
Mike
I’d try:
params[:category][:parent_id]
Mike Mannakee wrote:
Here’s a request string which has a value I want to pull out from the
category array - parent_id.
Parameters: {“category”=>{“name”=>“Condiments”, “parent_id”=>“1”},
“commit”=>“Create”}
How do I reference that subelement in the receiving script? I’ve tried
params[:parent_id]
params[:category[:parent_id]]
both unsuccessfully. I told you this was a stupid question. So how do
I
get at those values?
Mike
Hi Mike,
You were close It’s params[:category][:parent_id]
It’s a hash of hashes.
Best regards,
Bill
----- Original Message -----
From: “Mike Mannakee” [email protected]
To: [email protected]
Sent: Sunday, May 07, 2006 6:49 PM
Subject: [Rails] Stupid newbie question