RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: frostsquid
Nevermind... I found out my issue was that in the model I was still validating the presence of several fields (including the password).
This is great! But I am having a bit of an issue. I can not seem to get it to bypass the password as easily as it should be.
I am allowing login via facebook using the information from this railscasts. My resource is :subscriber instead of :user, but the rest is pretty much the same.
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
subscriber = Subscriber.from_omniauth(request.env["omniauth.auth"])
sign_in_and_redirect subscriber, notice: "Signed in!"
.....the rest of what you see in the railscasts
and my model contains:
# populates db with information from omniauth'ed subscriber(facebook)
where(auth.slice(:provider, :uid)).first_or_create do |subscriber|
subscriber.provider = auth.provider
subscriber.uid = auth.uid
subscriber.email = auth.info.email
subscriber.firstname = auth.info.first_name
subscriber.lastname = auth.info.last_name
# persists subscriber information through the session
# when omniauth'ed subscriber (facebook)
def self.new_with_session(params, session)
new(session["devise.subscriber_attributes"], without_protection: true) do |subscriber|
subscriber.attributes = params
super && provider.blank?
When I run debugger and interject immediately before subscriber.persisted? I can see I have a provider and a uid for subscriber, but subscriber.persisted? returns false because subscriber.new_record? is true.
What am I missing?