Rails的越来越未定义的方法在数据库中的现有场 [英] Rails getting undefined method for existing field in database
本文介绍了Rails的越来越未定义的方法在数据库中的现有场的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以,我在这个问题表中的字段,叫is_public..I迁移我的数据库,重新启动它,现在,当我得到这个错误每次我打电话is_public在问题记录的记录。
So I have a field in the question table, called is_public..I migrated my database, restarted it and now when I get this error everytime I call is_public for a record in the question records.
undefined method `is_public' for #<Question:0x7e9aa780>
任何想法,为什么发生这种情况?
Any ideas to why this is happening ?
推荐答案
您使用 attr_accessible
如果是这样,添加:is_public
到列表中。
Are you using attr_accessible?
If so, add :is_public
to the list.
这篇关于Rails的越来越未定义的方法在数据库中的现有场的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文