开发者

How to add Custom Fields using Devise on MongoDB?

开发者 https://www.devze.com 2023-03-19 09:01 出处:网络
I\'m trying to customize Devise on Rails using mongoid. I have setup devise and sign up and sign in pages are already showing. However, the fields are just email, password and password confirmation. I

I'm trying to customize Devise on Rails using mongoid. I have setup devise and sign up and sign in pages are already showing. However, the fields are just email, password and password confirmation. I want to add fields such as username and others. I've read instructions but they're all using active record. Does anyone know a simple way of doing this in Mongodb? Do I need to generate devise views just to add the username field on my sign up form? Any help or suggestions would be appreciated. Thanks 开发者_如何学Pythona lot in advance!


Yes, you are right, generate devise views with rails generate devise:views and customize it for your own needs.


and add the keys you require to your model and make it accessible;

field :name
attr_accessible :name
0

精彩评论

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