On Tue, Sep 8, 2009 at 9:00 AM, Ken Ghosh<meetme2meat / gmail.com> wrote:
> Hello everyone,
>
> =A0 I currently using Sinatra nad i must say its great.
> =A0 But I am currently stuck i wanted to passes a Name,value pair
> =A0 as a parameter to sinatra
>
> =A0 something like this
> =A0 http://localhost:4567/multiQuery?&Name_1=3D'ABC'&Name_2=3D'XYZ'&Name_=
3=3D'LMN'
>
> =A0 so that i can directly access values 'ABC','XYZ' and 'LMN'

There's a params attribute in Sinatra::Base that contains the query string:

This route:

get '/hello/:name' do |name|
        "Hello, #{name}. #{params.inspect}"
end

when called as:

http://localhost:4567/hello/x?a=3D3&b=3D4

produces:

Hello, x. {"name"=3D>"x", "a"=3D>"3", "b"=3D>"4"}

Hope this helps,

Jesus.