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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> 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) ? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
"Vikram" writes:> > Hi, > From my rails app, i need a way to reconstruct the currentrequest> url inside rhtml so that i can redirect to load the completepage in> some other canvas. For that, i need all query stringparameters. I> managed to construct the whole URL, but for cases where i havecomplex> params like abc[x]=Hello, abc[y]=world, i could only get to theextent> where i fetch them using reqest.query_parameters as a hash.But, how> do i reconstruct them into the URL? I may have to constructsomething> like abc%5Bx%5D%3DHello%26abc%5By%5D%3Dworld (encoded). > Or, is there a cleaner way of getting a lossless complete urlof 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---