March 4, 2012 § Leave a comment
November 13, 2011 § 3 Comments
This post is a reply from someone who emailed me, he asked me how to save the user data that already login to our site using facebook graph API.
after we create a login scheme using facebook and oauth2 gem, we need to save the facebook user data to our databases, so.. how to save it into the database?
it’s very easy and simple, when we get a callback from the facebook graph API and save the user data in session like this:
session[:fb_user] = JSON.parse access_token.get('/me') session[:user] = User.save_user_data(session[:fb_user])
July 5, 2011 § Leave a comment
since I wanna use the login page as a popup box use facebox.. not to redirected the user. the whole layout is appear to the facebox.. so how to make the layout false if we use devise?
simple.. check the current controller is a Devise::SessionsController or not in ApplicationController :
class ApplicationController < ActionController::Base layout :layout private def layout is_a?(Devise::SessionsController) ? false : "application" end end
October 27, 2010 § 6 Comments
I try to run “bundle install” (bundler gem) and in the middle of the installation process i got my hardisk space is full. so i cut the process and remove some data then try to install again, so i run the “bundle install” again and get error like this :
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/source.rb:199:in `cached_specs': undefined method `spec' for nil:NilClass (NoMethodError)
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/source.rb:196:in `cached_specs’
and many moooorreeee…..
that error caused of « Read the rest of this entry »
July 29, 2010 § 4 Comments
basically delayed job is using for background job. but we can use it as a recurring job.
here’s the step
first, install delayed_ojb gem. you can see how to install it at
then add a new library to your rails apps directory ( /Libs ) e.g: jobs.rb « Read the rest of this entry »
July 26, 2010 § 4 Comments
let’s get started !
first, install the oauth2 gem, you can get it from here
then create a controller call oauth_controller.rb « Read the rest of this entry »