Skip to content

Instantly share code, notes, and snippets.

@josefrichter
Created September 10, 2010 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josefrichter/573575 to your computer and use it in GitHub Desktop.
Save josefrichter/573575 to your computer and use it in GitHub Desktop.
<%= fb_connect_async_js %>
<% if current_facebook_user %>
<%= "Welcome #{current_facebook_user.first_name} #{current_facebook_user.last_name}!" %>
or
<%= "Hello #{fb_name(current_facebook_user, :useyou => false)}!" # link to facebook profile
%>
<%= fb_logout_link("Logout of fb", request.url) %><br />
<% else
# you must explicitly request permissions for facebook user fields.
# here we instruct facebook to ask the user for permission for our website
# to access the user's facebook email and birthday
%>
<%= fb_login_and_redirect('<your URL here>', :perms => 'email,user_birthday') %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment