2010-12-18 10 views

Odpowiedz

11

Możesz dodać 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 

przypuszczenia: 1. Zdefiniowano stronę logowania z linku (ów), takich jak: <%= link_to "Sign in with Facebook", "/auth/facebook" %>

Zobacz również RailsCasts tagged with authentication

Powiązane problemy