From: Brandon Weaver Date: 2012-09-22T00:38:08+09:00 Subject: Re: Need advice on a process --f46d042de92f951e8a04ca3802ea Content-Type: text/plain; charset=ISO-8859-1 I would look into either Sequel (Ruby only app) or ActiveRecord (if you're doing Rails) to handle the database interaction. This should take a lot of the SQL overhead out of the equation. I would almost consider just going over the Facebook API, or just going over a book like Railsspace if you're considering making your own Social Networking site. Brandon Weaver On Fri, Sep 21, 2012 at 8:17 AM, Paul Na wrote: > Hi all, > > I am making a FB app that has just one page that needs to deal with the > database. The process that i have done of far is: > > On post: > > Checks if fb user is logged in and app is authorized. > Checks if fb user is already in db. > if they are it updates the information. > else > if not then add record. > else > redirect to /auth/facebook > > So the bit i need advice with is that i was thinking the fb callback url > would be ideal to submit the information of: > > --------------------------------------- > Checks if fb user is already in db. > if they are it updates the information. > else > if not then add record. > --------------------------------------- > > So... > > if the user is not logged in, they log in, authorized the app, then > calls the fb callback url, > > or > > if the user is not logged in, they log in, but app is already > authorized, then calls the fb callback url, > > when in both cases it runs: > > --------------------------------------- > Checks if fb user is already in db. > if they are it updates the information. > else > if not then add record. > --------------------------------------- > > Does this sound ok to do. > > Thanks > > -- > Posted via http://www.ruby-forum.com/. > > --f46d042de92f951e8a04ca3802ea Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I would look into either Sequel (Ruby only app) or ActiveRecord (if you'= ;re doing Rails) to handle the database interaction. This should take a lot= of the SQL overhead out of the equation. I would almost consider just goin= g over the Facebook API, or just going over a book like Railsspace if you&#= 39;re considering making your own Social Networking site.

Brandon Weaver

On Fri, Sep= 21, 2012 at 8:17 AM, Paul Na <lists@ruby-forum.com> wrot= e:
Hi all,

I am making a FB app that has just one page that needs to deal with the
database. The process that i have done of far is:

On post:

Checks if fb user is logged in and app is authorized.
Checks if fb user is already in db.
if they are it updates the information.
else
if not then add record.
else
redirect to /auth/facebook

So the bit i need advice with is that i was thinking the fb callback url would be ideal to submit the information of:

---------------------------------------
Checks if fb user is already in db.
if they are it updates the information.
else
if not then add record.
---------------------------------------

So...

if the user is not logged in, they log in, authorized the app, then
calls the fb callback url,

or

if the user is not logged in, they log in, but app is already
authorized, then calls the fb callback url,

when in both cases it runs:

---------------------------------------
Checks if fb user is already in db.
if they are it updates the information.
else
if not then add record.
---------------------------------------

Does this sound ok to do.

Thanks

--
Posted via http://= www.ruby-forum.com/.


--f46d042de92f951e8a04ca3802ea--