[Rails] Re: redirect_to(URL) and return

2010-02-10 Thread Frederick Cheung
On Feb 10, 5:59 am, Smit Shah li...@ruby-forum.com wrote: Hi.. I am using an API. In that, I have to send data in query string. Now my question is how to get back from that site??? because it is not taking return_url from myside. It gives me response. I want to again redirect to some

[Rails] Re: redirect_to(URL) and return

2010-02-10 Thread Smit Shah
Frederick Cheung wrote: On Feb 10, 5:59�am, Smit Shah li...@ruby-forum.com wrote: % @url = www.abc.com/api?name=data % % response = redirect_to(@url) % % if response == true % � % redirect_to :action = 'success' % % else % � % redirect_to :action = 'failure' % % end % First off, this

[Rails] Re: redirect_to(URL) and return

2010-02-10 Thread Sharagoz --
You need to send a http request in the controller action and use that info to redirect the user. require 'net/http' connection = Net::HTTP.new(www.google.com) response = connection.start do |http| req = Net::HTTP::Get.new(/#hl=ensource=hpq=ruby+on+railsaq=faqi=g10oq=fp=c26c79a56c95bda8)