How do you add validations to devise?
I would like to add validations to the info of the tables of the user. E.G. email 开发者_开发问答must be with 6..20 or whatever How do I add these to the Devise gem?
I know that the use is with :validatable, however i'm not sure what the options are.
should I add normal validations `validates
Answer are written here.
In a nutshell:
to interact with devise columns, edit this file:
/config/initalizers/devise.rb
otherwise, just add your column as
attr_accessible
and write your normal validations.
精彩评论