我正在登录页面上为LinkedIn实施OmniAuth,但我收到此错误:
SyntaxError
/app/models/user.rb:9: syntax error, unexpected '\n', expecting =>
它正在看的代码是:
class User < ActiveRecord::Base
attr_accessor :email, :password, :password_confirmation
VALID_EMAIL_REGEX = /([\w+.]+)@[a-z0-9\-.]+\.[a-z]+/i
validates :email, presence: true,
format: { with: VALID_EMAIL_REGEX },
uniqueness: { case_sensitive: false }
validates :password, presence: true, length: { minimum: 6 }
validates :password_confirmation, presence: true
devise :rememberable, :omniauthable, :omniauth_providers => [:linkedin], :trackable
end
有什么建议吗?
答案 0 :(得分:4)
尝试重新排序
devise :rememberable, :omniauthable, :trackable, :omniauth_providers => [:linkedin]