Forum: Ruby on Rails redirect_to("url") with post?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bae2751befa42329af2895b1d74c4036?d=identicon&s=25 David Humphreys (Guest)
on 2006-03-30 19:57
(Received via mailing list)
Is there a Rails-friendly way to redirect_to an url and post some
parameters with that?

I've tried:

redirect_to("http://whatever.com",  { 'postme' => 'this' })
redirect_to("http://whatever.com",  :post => { 'postme' => 'this' })
redirect_to("http://whatever.com",  :options => { 'postme' => 'this' })

... and no love.

Thanks!

--
David Humphreys
dave@dbhumphreys.com
89d967359903c639d31e4cad4569f537?d=identicon&s=25 Charlie Bowman (Guest)
on 2006-03-30 20:15
(Received via mailing list)
redirect_to("http://whatever.com?postme=this")


On Thu, 2006-03-30 at 11:56 -0600, David Humphreys wrote:

>
> Thanks!
>
> --
> David Humphreys
> dave@dbhumphreys.com
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails


Charlie Bowman
http://www.recentrambles.com
Ff86e52a9c4e1d5b42f11f5f0bb458c6?d=identicon&s=25 Ben Blakley (brblakley)
on 2006-10-11 00:50
Is this the only way to post/pass variables when redirecting a request
to another server?

> redirect_to("http://whatever.com?postme=this")

I'd like to be able to hide the variables instead of sending them in the
URL. For example, when logged into Basecamp you can view/create
Writeboards without logging into Writeboard even though you are
redirected to a different server/domain. It doesn't appear to me that
your login or authentication info is being passed from Basecamp to
Writeboard in the URL. Does anyone know how this is done? Thanks!
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark Reginald James (Guest)
on 2006-10-11 13:13
(Received via mailing list)
Ben Blakley wrote:
> redirected to a different server/domain. It doesn't appear to me that
> your login or authentication info is being passed from Basecamp to
> Writeboard in the URL. Does anyone know how this is done? Thanks!

According to http://ppewww.ph.gla.ac.uk/~flavell/www/post-redirect.html
you can control whether a POST redirects as a GET or a POST by changing
the response status code.

But if you don't need to do stuff in your action prior to redirecting
you can just post directly to the external site from a form on your
page.

--
We develop, watch us RoR, in numbers too big to ignore.
Ff86e52a9c4e1d5b42f11f5f0bb458c6?d=identicon&s=25 Ben Blakley (brblakley)
on 2006-10-11 19:42
Thanks Mark. I took another look at how 37signals did the Basecamp to
Writeboard redirection and found out that it is handled by loading up an
intermediate page on the Basecamp server that contains a pre-populated
login form for Writeboard. That page has an onload Javascript function
that then submits the form to Writeboard. Seems to work well except for
those using IE PC with their security settings set to "High" as
described here:

http://everything.basecamphq.com/archives/000438.php
This topic is locked and can not be replied to.