Forum: Ruby on Rails Stupid newbie question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B4c21866846b5dc55c68acd66c4c2f11?d=identicon&s=25 Mike Mannakee (Guest)
on 2006-05-08 01:51
(Received via mailing list)
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
F5c118aaeb5bb7162db613a37e595be8?d=identicon&s=25 Mick Sharpe (micksharpe)
on 2006-05-08 02:05
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
2b891e820c238ded365d035771603f21?d=identicon&s=25 Bill Walton (Guest)
on 2006-05-08 02:15
(Received via mailing list)
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" <mike@basementideas.com>
To: <rails@lists.rubyonrails.org>
Sent: Sunday, May 07, 2006 6:49 PM
Subject: [Rails] Stupid newbie question
This topic is locked and can not be replied to.