Forum: Ruby on Rails Some problems with redirect_to method

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.
E499e36634899e0c0aa4eac98c8e307f?d=identicon&s=25 Sophy Eung (ungsophy)
on 2007-06-04 06:52
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?
72eb65fa089082d3bd8b38a5596ad331?d=identicon&s=25 Keynan Pratt (keynan)
on 2007-06-04 07:08
thats weird. Mind I've had it happen.

Could you post the source for the pages that comes up inplace of a
redirect
This topic is locked and can not be replied to.