【发布时间】:2014-11-18 17:01:06
【问题描述】:
我想为 :minimum 编写自定义错误消息,而为 :maximum 编写其他错误消息
我有以下代码行
validates_length_of :user_name, :minimum=>5,:maximum=>30
ej if the length of :user_name is < 5 "The user_name must to have 5 characters as minimum"
ej if the length of :user_name is > 30 "The user_name must to have 30 characters as maximum"
【问题讨论】:
标签: ruby-on-rails ruby ruby-on-rails-3 ruby-on-rails-4