首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Validates_format_of?

Validates_format_of?
EN

Stack Overflow用户
提问于 2011-01-25 01:28:17
回答 1查看 539关注 0票数 0
代码语言:javascript
复制
1 error prohibited this {{model}} from being saved

  There were problems with the following fields:

    * {{attribute}} {{message}}

我得到了这个错误,我使用的代码是:

代码语言:javascript
复制
validates_format_of :user_id , :with => /\A(([0-9]{4})-[A-Z]{2}$)\Z/ , :message => "should be in the format 1111-TT", :allow_nil => true, :allow_blank => true

知道这是什么原因吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-01-25 03:16:08

我在使用Rails 2和i18n 0.5.0时也遇到了同样的问题。在您的环境中卸载i18n 0.5.0或指定旧版本(我使用的是0.4.1)。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4785023

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档