query string

Reply

Join Date: Nov 2006
Posts: 44
Reputation: amithasija is an unknown quantity at this point 
Solved Threads: 0
amithasija amithasija is offline Offline
Light Poster

query string

 
0
  #1
May 16th, 2007
can anybody tell me how to get the values from querystring.

thanx in advance to all..
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 521
Reputation: pty is on a distinguished road 
Solved Threads: 37
pty's Avatar
pty pty is offline Offline
Posting Pro

Re: query string

 
0
  #2
May 20th, 2007
Originally Posted by amithasija View Post
can anybody tell me how to get the values from querystring.

thanx in advance to all..
  1. params[:param_name]

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



  1. params[:page_number]
Note to self... pocket cup
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 44
Reputation: amithasija is an unknown quantity at this point 
Solved Threads: 0
amithasija amithasija is offline Offline
Light Poster

Re: query string

 
0
  #3
May 21st, 2007
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..
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 521
Reputation: pty is on a distinguished road 
Solved Threads: 37
pty's Avatar
pty pty is offline Offline
Posting Pro

Re: query string

 
0
  #4
May 21st, 2007
Originally Posted by amithasija View Post
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:

  1. params.each do |key, value|
  2. #do something fancy!
  3. end
Note to self... pocket cup
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 44
Reputation: amithasija is an unknown quantity at this point 
Solved Threads: 0
amithasija amithasija is offline Offline
Light Poster

Re: query string

 
0
  #5
May 21st, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2003
Posts: 360
Reputation: Gary King will become famous soon enough Gary King will become famous soon enough 
Solved Threads: 5
Team Colleague
Gary King's Avatar
Gary King Gary King is offline Offline
PHP/vBulletin Guru

Re: query string

 
0
  #6
May 22nd, 2007
env["QUERY_STRING"] should work.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 44
Reputation: amithasija is an unknown quantity at this point 
Solved Threads: 0
amithasija amithasija is offline Offline
Light Poster

Re: query string

 
0
  #7
May 23rd, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2003
Posts: 360
Reputation: Gary King will become famous soon enough Gary King will become famous soon enough 
Solved Threads: 5
Team Colleague
Gary King's Avatar
Gary King Gary King is offline Offline
PHP/vBulletin Guru

Re: query string

 
0
  #8
May 23rd, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1
Reputation: aoooddy is an unknown quantity at this point 
Solved Threads: 0
aoooddy aoooddy is offline Offline
Newbie Poster

Re: query string

 
0
  #9
Jun 8th, 2007
internet explorer download
---------------------------------------
http://www.greatdownload.org
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Ruby Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC