# Some problems with redirect\_to method

**URL:** <https://www.ruby-forum.com/t/some-problems-with-redirect-to-method/105872>\
**Category:** Rails\
**Created:** [June 4, 2007, 6:52am UTC](https://www.ruby-forum.com/t/some-problems-with-redirect-to-method/105872 "2007-06-04T06:52:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ungsophy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/a5b964/32.png) [@ungsophy](https://www.ruby-forum.com/u/ungsophy)\
**Post date:** [June 4, 2007, 6:52am UTC](https://www.ruby-forum.com/t/some-problems-with-redirect-to-method/105872/1 "2007-06-04T06:52:49Z")

</div>

Hi everyone,

I have developed a login form that allow users to login using their  
gmail account. Enabling users to login using their gmail account I use  
XMPP4R library which is written in ruby. When users provide correct  
userid and password then i redirect them to home page, otherwise i  
redirect them to login page again. Rails does not redirect users to  
anywhere, but it display a link says “You are being redirect.”. If users  
click the link it will bring users to the destination. Below is my code:

require ‘xmpp4r/client’  
include Jabber

class LoginController \< ApplicationController

def index

end

def whollycity\_authen  
login = params[:login]  
username = JID::new(login[:username] + “@” + login[:server] +  
“.com”)  
password = login[:password]  
user = Client::new(username)  
begin  
user.connect  
user.auth(password)  
redirect\_to :controller =\> “home”  
rescue  
redirect\_to :controller =\> “login”  
end  
end

end

can anyone help?

---

<div class="post-metadata">

**Author:** ![ungsophy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/a5b964/32.png) [@ungsophy](https://www.ruby-forum.com/u/ungsophy)\
**Post date:** [June 4, 2007, 7:08am UTC](https://www.ruby-forum.com/t/some-problems-with-redirect-to-method/105872/2 "2007-06-04T07:08:27Z")

</div>

thats weird. Mind I’ve had it happen.

Could you post the source for the pages that comes up inplace of a  
redirect
