DG IZ; logged in as?
This commit is contained in:
parent
53c0aff23d
commit
159d72c04c
2 changed files with 17 additions and 3 deletions
|
|
@ -9,6 +9,7 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
before_filter :set_friends_and_status, :except => [:create, :update]
|
||||
before_filter :count_requests
|
||||
before_filter :fb_user_info
|
||||
|
||||
layout :layout_by_resource
|
||||
|
||||
|
|
@ -37,4 +38,9 @@ class ApplicationController < ActionController::Base
|
|||
@request_count = Request.for_user(current_user).size if current_user
|
||||
end
|
||||
|
||||
def fb_user_info
|
||||
@access_token = cookies[:access_token]
|
||||
@logged_in = @access_token.present?
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -56,10 +56,18 @@
|
|||
%br
|
||||
%br
|
||||
|
||||
%h3 Connect with Facebook
|
||||
|
||||
%p
|
||||
= link_to "Login to Facebook", @fb_access_url
|
||||
%h2 Services
|
||||
|
||||
%h3 Facebook
|
||||
|
||||
- if @logged_in
|
||||
Logged in to facebook as
|
||||
- @response_hash = MiniFB.get(@access_token, @id, :type => "user")
|
||||
= @response_hash[:user][:name]
|
||||
%p
|
||||
= link_to "Login to Facebook", @fb_access_url
|
||||
|
||||
|
||||
#submit_block
|
||||
= link_to "Cancel", root_path
|
||||
|
|
|
|||
Loading…
Reference in a new issue