Last Updated: February 25, 2016
·
1.191K
· pahnin

Setting up CURD interface to model which has devise setup

Devise is a ruby gem used in rails for authentication.
The project I have been working on requires an admin namespace and user namespace both use device to login. In admin name space we needed a CURD interface for user table which is associated with devise for login.
So I coded the controllers and views.
I saved the user record by assigning email,password and username to new User object, but the problem is with just these attributes devise saves the record to User model but it does not encrypt the password which and encrypted_password field is empty it uses in authentication model.

I told my problem to https://twitter.com/coder_hsps and he suggested assigning same password to password_confirmation attribute in my controller and it worked

Thanks