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.
David H. (Guest)
on 2006-03-30 21: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 H.
removed_email_address@domain.invalid
Charlie B. (Guest)
on 2006-03-30 22:15
(Received via mailing list)
redirect_to("http://whatever.com?postme=this")


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

>
> Thanks!
>
> --
> David H.
> removed_email_address@domain.invalid
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails


Charlie B.
http://www.recentrambles.com
Ben B. (Guest)
on 2006-10-11 02: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!
Mark Reginald J. (Guest)
on 2006-10-11 15: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.
Ben B. (Guest)
on 2006-10-11 21: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.