Reconstructing url with complex params

Hi,
From my rails app, i need a way to reconstruct the current request
url inside rhtml so that i can redirect to load the complete page in
some other canvas. For that, i need all query string parameters. I
managed to construct the whole URL, but for cases where i have complex
params like abc[x]=Hello, abc[y]=world, i could only get to the extent
where i fetch them using reqest.query_parameters as a hash. But, how
do i reconstruct them into the URL? I may have to construct something
like abc%5Bx%5D%3DHello%26abc%5By%5D%3Dworld (encoded).
Or, is there a cleaner way of getting a lossless complete url of the
current page with all the params?

-Vikram

“Vikram” writes:

Hi,
From my rails app, i need a way to reconstruct the current
request
url inside rhtml so that i can redirect to load the complete
page in
some other canvas. For that, i need all query string
parameters. I
managed to construct the whole URL, but for cases where i have
complex
params like abc[x]=Hello, abc[y]=world, i could only get to the
extent
where i fetch them using reqest.query_parameters as a hash.
But, how
do i reconstruct them into the URL? I may have to construct
something
like abc%5Bx%5D%3DHello%26abc%5By%5D%3Dworld (encoded).
Or, is there a cleaner way of getting a lossless complete url
of the
current page with all the params?

I recommend using the url_for(:overwrite_params => {}) construct
as it allows you to overwrite controller, action as well as
parameters while retaining most of the original request url.

– Long
http://FATdrive.tv/wall/trakb/10-Long
http://FATdrive.tv/ - store, play, share

From my rails app, i need a way to reconstruct the current request
url inside rhtml so that i can redirect to load the complete page in
some other canvas. For that, i need all query string parameters. I
managed to construct the whole URL, but for cases where i have complex
params like abc[x]=Hello, abc[y]=world, i could only get to the extent
where i fetch them using reqest.query_parameters as a hash. But, how
do i reconstruct them into the URL? I may have to construct something
like abc%5Bx%5D%3DHello%26abc%5By%5D%3Dworld (encoded).
Or, is there a cleaner way of getting a lossless complete url of the
current page with all the params?

Would this work?

url_for(params)

?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs