rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
* Rack: adding a query parameter before call
@ 2011-04-24 14:34 Ned
  2011-04-24 17:58 ` Lee Hambley
  0 siblings, 1 reply; 3+ messages in thread
From: Ned @ 2011-04-24 14:34 UTC (permalink / raw)
  To: Rack Development

Hey

I'm trying to add a query parameter before the call to my rails
app ... through Rake

Thought itd of been simple, but struggling...

Can anyone help?

thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Rack: adding a query parameter before call
  2011-04-24 14:34 Rack: adding a query parameter before call Ned
@ 2011-04-24 17:58 ` Lee Hambley
  2011-04-24 19:45   ` Sylvain Desvé
  0 siblings, 1 reply; 3+ messages in thread
From: Lee Hambley @ 2011-04-24 17:58 UTC (permalink / raw)
  To: rack-devel

[-- Attachment #1: Type: text/plain, Size: 50 bytes --]

Example please Ned… (the code you have so far)

[-- Attachment #2: Type: text/html, Size: 54 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Rack: adding a query parameter before call
  2011-04-24 17:58 ` Lee Hambley
@ 2011-04-24 19:45   ` Sylvain Desvé
  0 siblings, 0 replies; 3+ messages in thread
From: Sylvain Desvé @ 2011-04-24 19:45 UTC (permalink / raw)
  To: rack-devel

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

I think you meant "Rack" and not "Rake". If so, here is a method to add a
parameter to the query string :

use Rack::Config do |env|
  env["QUERY_STRING"] += "&" unless env["QUERY_STRING"].empty?
  env["QUERY_STRING"] += "" + Rack::Utils.build_query(:my_new_parameter =>
"and its value")
end

2011/4/24 Lee Hambley <lee.hambley@gmail.com>

> Example please Ned… (the code you have so far)
>

[-- Attachment #2: Type: text/html, Size: 838 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-24 19:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-24 14:34 Rack: adding a query parameter before call Ned
2011-04-24 17:58 ` Lee Hambley
2011-04-24 19:45   ` Sylvain Desvé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).