•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Ruby section within the Web Development category of DaniWeb, a massive community of 426,411 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,332 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Ruby advertiser: SELL YOUR PRODUCT TODAY !
Views: 4212 | Replies: 8
![]() |
•
•
Join Date: Nov 2006
Location: new delhi
Posts: 39
Reputation:
Rep Power: 2
Solved Threads: 0
can anybody tell me how to get the values from querystring.
thanx in advance to all..
thanx in advance to all..
•
•
Join Date: Oct 2005
Location: Manchester, UK
Posts: 482
Reputation:
Rep Power: 3
Solved Threads: 33
•
•
•
•
can anybody tell me how to get the values from querystring.
thanx in advance to all..
ruby Syntax (Toggle Plain Text)
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)
params[:page_number]
Note to self... pocket cup
•
•
Join Date: Nov 2006
Location: new delhi
Posts: 39
Reputation:
Rep Power: 2
Solved Threads: 0
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..
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..
•
•
Join Date: Oct 2005
Location: Manchester, UK
Posts: 482
Reputation:
Rep Power: 3
Solved Threads: 33
•
•
•
•
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)
params.each do |key, value| #do something fancy! end
Note to self... pocket cup
•
•
Join Date: Nov 2006
Location: new delhi
Posts: 39
Reputation:
Rep Power: 2
Solved Threads: 0
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.
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.
•
•
Join Date: Nov 2003
Location: Toronto, Canada
Posts: 354
Reputation:
Rep Power: 6
Solved Threads: 5
env["QUERY_STRING"] should work.
•
•
Join Date: Nov 2006
Location: new delhi
Posts: 39
Reputation:
Rep Power: 2
Solved Threads: 0
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.
•
•
Join Date: Nov 2003
Location: Toronto, Canada
Posts: 354
Reputation:
Rep Power: 6
Solved Threads: 5
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 12:40 pm.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Ruby Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Removing Query Strings (ASP.NET)
- Generate sql string to query MySQL DB ? (PHP)
- encrypt and decrypt query string (VB.NET)
- Dynamic query string (Search Engine Optimization)
- Coverting a string to a byte array (Visual Basic 4 / 5 / 6)
Other Threads in the Ruby Forum
- Previous Thread: execute ruby
- Next Thread: need help with learning ruby


Linear Mode