开发者

Devise authentication undefined method 'to_sym'?

Im trying to set up an authentication system against an LDAP active directory using devise. (following the tutorial http://wiki.phys.ethz.ch/readme/devise_with_ldap_for_authentication_in_rails_3

Ive followed the instruction exactly, and when i try running the app im getting the following error:

undefined method `to_sym' for #<ActiveModel::MassAssignmentSecurity::WhiteList:0x2a4abd50

And i dont even know where to_sym is because it doesnt tell me! Anyone know the cause of this or at least how to find the file that contains this line? *******UPDATE*******

user.rb model:

class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable
and :omniauthable
  devise :ld开发者_StackOverflowap_authenticatable,
       :rememberable, :trackable,

  # Setup accessible (or protected) attributes for your model
  attr_accessible(:login, :password, :password_confirmation, :remember_me)
end


It looks like there is a trailing comma after the last argument to the devise method:

devise :ldap_authenticatable, :rememberable, :trackable,

The ruby interpreter then assumes that attr_accessible is the next argument to the method. The proper argument type is a symbol, so it calls to_sym on attr_accessible, which is a method and does not have a to_sym method and raises the error.

Remove the trailing comma and it should work!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜