Google Latitude : Ruby on Rails Example using Oauth

A good Example of Google Latitude on Ruby on Rails that was
what I was searching for the past few days .I thought it
would be good to include this one in my blog as it already
contained a lot of stuff on Google Latitude .

This are the simple steps you need to follow to
have your Google Latitude Oauth on Ruby on Rails
running .

Upload the rsacert.pem, and keep the rsakey.pem in a
safe place. For the Target URL path prefix, Just add
the domain name.

Get the Oauth Consumer Key and Secret .

2) OAuth GEM

Include in your environment.rbconfig.gem "oauth"
You need to install it to use in your system .
Recommended version 0.4.1 .

3) Generate OAuth Access Token Model

$ ruby script/generate model OAuthAccessToken
Note: I've done this because I don't want to store
my access token directly in my User model. This
gives me the option of having tokens for multiple
scopes for a user through a polymorphic association.

That's pretty much it. Go to http://localhost:3000/latitude,
you will be directed to Google to authorise your account,
then once that all goes through, you will be sent back to
your app, an Access Token will be created which will be
stored for your user. I'm not exactly sure how long this
lasts at the moment, but I'm testing that right now and
will update if I find anything important. Sorry guys just
can't show you a live demo right now . But if anyone of
you make one please do leave a comment over here ,so that
I can tell my readers "Hey checkout this live Demo".