Answer the question
In order to leave comments, you need to log in
How to fix undefined method `remote_avatar_url='?
I'm trying to connect authorization through omniauth-twitter
Gives an error
undefined method `remote_avatar_url=' for #<User:0x0000000012a69c00> Did you mean? remove_instance_variable
def self.find_or_create_from_twitter_omniauth(auth)
user = where(provider: auth.provider, uid: auth.uid).first_or_create
unless auth.info.image.nil?
user.remote_avatar_url = auth.info.image.gsub('http://', 'https://').gsub('_normal', '')
end
user.update(
username: auth.info.name,
password: Devise.friendly_token[0, 20],
email: "#{SecureRandom.hex}#{auth.info.nickname}"
)
user
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question