How do I chomp a redirect url in rails? I'm having trouble with Twitter's OAuth -


I'm having a very strange and frustrating problem with the Twitter API. The OAuth process is working just fine at the local level But once I put the site in my lock it automatically connects the URL of the test server and redirects to a broken page. This code is:

  def oauth oauth = Twitter :: OAuth.new ('*', '*') request_token = oauth.request_token (: oauth_callback = & gt; 'http: // Strong-ice-53.heroku.com/callback ') session [: request_token] = request_token.token session [: request_token_secret] = request_token.secret session [: returnurl] = param [[returnurl] redirect_to request_token.authorize_url end  

Locally sends me to api.twitter.com/ ... just fine. But once sent me online ... which gives me an error

I have tried to chop the redirect but it does not seem to work:

  Redirect_to request_token.authorize_url.chomp ("strong-ice-53.heroku.com")  

Any help would be greatly appreciated. I am a noob to do all this.

Which Twitter Oath are you using? It looks like a bug for me.

In addition, can you please inspect the contents of the variable request_token.authorize_url ? This should do something like this:

  def oauth oauth = Twitter :: OAuth.new ('*', '*') request_token = oauth.request_token (: oauth_callback = & gt; Http: //strong-ice-53.heroku.com/callback ') session [: request_token] = request_token.token session [: request_token_secret] = request_token.secret session [: returnurl] = param [: returnurl] logger.info ( "\ N \ n \ n \ n # {request_token.authorize_url.inspect} \ n \ n \ n \ n") redirect_to request_token.authorize_url termination  

and then the server for output See


Comments