ruby on rails - How to create a user using code when i am using devise gem for Sign up / Sign in -


i using devise gem application. create user using code, in database table "users" password encrypted. hope cannot directly save as

    new_user = user.new  new_user.email = "xyz@xys.com"  new_user.password = "1sdf" - cannot use becs : encrypted_password  new_user.save   

is possible?

you should able actually, devise's encrypted_password method handle encrypting password pass in , storing in database

u = user.new(:email => "foo@bar.com", :password => '1sdf', :password_confirmation =>       '1sdf') u.save 

try out in rails console.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -