Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This area seems to be heavily in flux. I had a difficult time getting it set up with Rails 3 since none of the main Ruby facebook libraries are officially updated for it yet, and the newest ones aren't documented.</p> <p>The way I got it working with Rails 3 was using Facebooker2 and Mogli. I basically took the mogli + authlogic oauth controller code <a href="http://groups.google.com/group/facebooker/msg/1d96dd19c61e76a8" rel="nofollow noreferrer">posted here</a> and combined it with Facebooker2's controller and helper methods. There's no documentation (that I know of) for Facebooker2 and Mogli, but the Facebooker2 code is relatively straightforward.</p> <p>I also had to manually deal with some of the authlogic validations in order to have them trigger only for non-facebook signups. Here is all the authlogic-specific code in the user model:</p> <pre><code>class User &lt; ActiveRecord::Base acts_as_authentic do |config| config.validate_email_field = false end validates_length_of :email, :within =&gt; 6..100, :if =&gt; :is_not_fb_user? validates_format_of :email, :with =&gt; Authlogic::Regex.email, :if =&gt; :is_not_fb_user? validates_uniqueness_of :email, :if =&gt; :is_not_fb_user? def is_fb_user? return false if self.fb_uid.blank? || self.fb_uid == 0 || self.fb_at.blank? return true end def is_not_fb_user?; !self.is_fb_user? end def require_password? if self.is_fb_user? false else new_record? || password_changed? || send(crypted_password_field).blank? end end end </code></pre> <p>There might be some bugs and I suspect there is a better way to approach this.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload