开发者

Rails 3: how to require at least one field not to be blank

I have a model that has several properties. I want to va开发者_StackOverflow中文版lidate that at least one of those properties is set. I saw the post here, but the errors.add_to_base is now deprecated in Rails 3 and was wondering what the new solution might be.


It's now simply

errors.add(:base, "message")
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜