undefined method `find_by_provder_and_uid' for []:Array
I'm following along with the开发者_运维问答 tutorial here:
http://asciicasts.com/episodes/235-omniauth-part-1
In my controller I created the following method:
def create
auth = request.env["omniauth.auth"]
current_user.authentications.find_or_create_by_provder_and_uid(auth['provider'], auth['uid'])
flash[:notice] = "Authentication successful."
redirect_to authentications_url
end
Problem is it is erroring like so:
undefined method `find_by_provder_and_uid' for []:Array
Ideas why? thanks
It looks like that page has a typo -- it should be:
current_user.authentications.find_or_create_by_provider_and_uid(auth['provider'], auth['uid'])
The original Railcast has it spelled properly. I just e-mailed the AsciiCasts author notifying him of the typo.
精彩评论