开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜