I am trying to do a sign in with facebook/twitter, and following this railscast
I have added the following to my config/initializers/devise.rb (where I did put in my consumer key and consumer secret as provided by Twitter).
config.omniauth :twitter, ENV["TWITTER_CONSUMER_KEY"], ENV["TWITTER_CONSUMER_SECRET"]
After adding ":omniauthable" to my user model, The following produces this error "undefined local variable or method `resource_class' for #<#:0x007febf67af938>"
- if devise_mapping.omniauthable?
- resource_class.omniauth_providers.each do |provider|
I solved this by removing the "ENV[]" brackets:
config.omniauth :twitter, 'TWITTER_CONSUMER_KEY', 'TWITTER_CONSUMER_SECRET'
and defining resource_class in my application_helper.rb
def resource_class
devise_mapping.to
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With