Problems with Ruby on Rails and Mechanize gem?

Hi all.

I'm doing a web site using "WWW::Mechanize".

when I make click on the Iink, I want to log with my google mail, this already works but now, I want to show the home page after logged.

This is my source:

require 'rubygems' require 'mechanize'

def loggin     user = ''     pass = 'abc123'

    agent =     page = agent.get '

    form = page.forms.first     form.login = user     form.passwd = pass

    page = agent.submit form

  # I tried this, but it didn't work     redirect_to '’ end