Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. # validates
  2.  
  3. validates :name,
  4. presence: true,
  5. uniqueness: true,
  6. length: { maximum: 32 },
  7. format: { with: /\A[a-z|0-9|_]+\z/ } # 半角アルファベット, 数値, アンスコのみ
  8.  
  9. validates :postal_code,
  10. format: { with: /\A\d{7}\z/ },
  11. allow_blank: true
  12.  
  13. validates :address,
  14. length: { maximum: 255 },
  15. allow_blank: true
  16.  
  17. validates :tel,
  18. length: { maximum: 13 },
  19. format: { with: /\A\d{2,}+-\d{4}+-\d{4}+\z/ },
  20. allow_blank: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement