2010-12-18 15 views

Respuesta

11

Se puede añadir un before_filter:

class ApplicationController < ActionController::Base 

    before_filter :authenticate 

    def authenticate 
    redirect_to :login unless User.find_by_provider_and_uid(auth["provider"], auth["uid"]) 
    end 
... 
end 

Presuming: 1. Ha definido una página de acceso a enlace (s) como: <%= link_to "Sign in with Facebook", "/auth/facebook" %>

Véase también RailsCasts tagged with authentication

Cuestiones relacionadas