From: John Zorko Date: 2008-05-14T22:39:13+09:00 Subject: Re: how to do the equivalent of PHP's "$_GET" in Ruby? --Apple-Mail-59-536906824 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Matthew, Indeed, this is a Rails question ... i'm new to this :-) My next question is -- what is the structure of the params hash i.e. how do I access it's name / value pairs without knowing in advance what the name will be? To use your example: GET /controller/action/1?question_id=forsure I want to do something like this: params.each { | param | do url << param[ :name ] << "=" << param[ :value ] << "&" end ... but I don't know how to refer to the name / value (I used :name and :value here to get the point across). Regards, John Falling You - exploring the beauty of voice and sound http://www.fallingyou.com On May 14, 2008, at 6:00 AM, Matthew Rudy Jacobs wrote: > John Zorko wrote: >> Hello, all ... >> >> I'm new to Ruby, but so far, I like it quite a lot. I've a question, >> though ... I need to do the Ruby equivalent of PHPs "$_GET" ... how >> do >> I do this? >> >> Regards, >> >> John >> >> Falling You - exploring the beauty of voice and sound >> http://www.fallingyou.com > > is this a Rails question? > > in Rails, > the "params" method called inside your controller > grabs all of the http params, > GET or POST. > > eg. GET /controller/action/1?question_id=forsure > >> params > -> {"id" => "1", "question_id" => "forsure"} > -- > Posted via http://www.ruby-forum.com/. > --Apple-Mail-59-536906824--