0
我想在我的Rails項目中使用「has_secure_password」。我在我的Gemfile中包含了bcrypt gem並運行了bundle安裝。然而,當我運行該項目,我收到以下錯誤:Rails 4中has_secure_password錯誤
NameError in UsersController#index
undefined local variable or method `has_secure_pasword' for #<Class:0x00000004169e38>
User類
class User < ActiveRecord::Base
has_secure_pasword
validates :password, length: { minimum: 6 }
end
關於如何解決此問題的任何想法? 我還沒有創建任何用戶 - 這可能是問題嗎?
謝謝!應該很小心 – user3813256
@ user3813256有趣的是,您在標題中正確命名,並在代碼中錯過了:D – Pavan