error_messages_for 在 ruby​​ 中已弃用 - 如何找到替代品? [英] error_messages_for is deprecated in ruby - how do I find the replacement?

查看:40
本文介绍了error_messages_for 在 ruby​​ 中已弃用 - 如何找到替代品?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读一本旧书(2008 年)来学习 ruby​​,它适用于 rails 2.0.2.

I am reading an old book (2008) to learn ruby and it is for rails 2.0.2.

我决定使用 Rails 3 来找出当时的 ruby​​ 与现在的区别.到目前为止,大部分内容都很好,我很容易找到并纠正差异.

I have decided to use Rails 3 to find out the differences between the ruby back then to what it is now. Most of it has been good so far and I have been easily been able to find and correct the differences.

我现在遇到的问题是代码使用了不推荐使用的函数 error_messages_for 并查看 http://apidock.com/rails/ActionView/Helpers/ActiveRecordHelper/error_messages_for 我找不到替代品或任何方式来告诉我什么是新方式.有人可以帮助我找到使用 error_messages_for 的新方法,以及我应该如何寻找新的做事方法和发现新的最佳实践的方法等.

The problem I am having now, is that the code is using a deprecated function error_messages_for and upon looking at http://apidock.com/rails/ActionView/Helpers/ActiveRecordHelper/error_messages_for I cannot find a replacement or any way to show me what the new way is. Can someone help me find the new way to use error_messages_for and how I should go about finding the new way to do things and the way to discover the new best practices etc.

推荐答案

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆