943,789 Members | Top Members by Rank

Ad:
  • Ruby Discussion Thread
  • Unsolved
  • Views: 8893
  • Ruby RSS
May 16th, 2007
0

query string

Expand Post »
can anybody tell me how to get the values from querystring.

thanx in advance to all..
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
amithasija is offline Offline
44 posts
since Nov 2006
May 20th, 2007
0

Re: query string

Click to Expand / Collapse  Quote originally posted by amithasija ...
can anybody tell me how to get the values from querystring.

thanx in advance to all..
ruby Syntax (Toggle Plain Text)
  1. params[:param_name]

So say for example you're using pagination and you want the page_number param list?page_number=1:



ruby Syntax (Toggle Plain Text)
  1. params[:page_number]
pty
Reputation Points: 64
Solved Threads: 39
Posting Pro
pty is offline Offline
530 posts
since Oct 2005
May 21st, 2007
0

Re: query string

thanx pty for quick reply,

but if i have suppose 7 parameters in query string and i want to access the value for all 7 parameters in one go, how can i do that..
Reputation Points: 10
Solved Threads: 0
Light Poster
amithasija is offline Offline
44 posts
since Nov 2006
May 21st, 2007
0

Re: query string

Click to Expand / Collapse  Quote originally posted by amithasija ...
thanx pty for quick reply,

but if i have suppose 7 parameters in query string and i want to access the value for all 7 parameters in one go, how can i do that..
The params are in a hash (eg {"action"=>"list", "filter"=>"closed", "controller"=>"issue"}. If you want to iterate through them for example use:

ruby Syntax (Toggle Plain Text)
  1. params.each do |key, value|
  2. #do something fancy!
  3. end
pty
Reputation Points: 64
Solved Threads: 39
Posting Pro
pty is offline Offline
530 posts
since Oct 2005
May 21st, 2007
0

Re: query string

hi pty,

is there any special function to retrive the complete query string path,i have read from manual that this function is used to retrieve complete string,
ENV['QUERY_STRING'],but i am not able to get it working.
Reputation Points: 10
Solved Threads: 0
Light Poster
amithasija is offline Offline
44 posts
since Nov 2006
May 22nd, 2007
0

Re: query string

env["QUERY_STRING"] should work.
Team Colleague
Reputation Points: 53
Solved Threads: 5
PHP/vBulletin Guru
Gary King is offline Offline
360 posts
since Nov 2003
May 23rd, 2007
0

Re: query string

thanx gary for your reply but i want to know that ,do i need to install or include some file to get it working as its not working if i only add this line of code only.
Reputation Points: 10
Solved Threads: 0
Light Poster
amithasija is offline Offline
44 posts
since Nov 2006
May 23rd, 2007
0

Re: query string

Try using controller.env['QUERY_STRING'], where controller is the name of the controller where you are using this.
Last edited by Gary King; May 23rd, 2007 at 1:40 pm.
Team Colleague
Reputation Points: 53
Solved Threads: 5
PHP/vBulletin Guru
Gary King is offline Offline
360 posts
since Nov 2003
Jun 8th, 2007
0

Re: query string

internet explorer download
---------------------------------------
http://www.greatdownload.org
Reputation Points: 10
Solved Threads: 0
Newbie Poster
aoooddy is offline Offline
1 posts
since Jun 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Ruby Forum Timeline: execute ruby
Next Thread in Ruby Forum Timeline: need help with learning ruby





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC