Rails getting undefined method for existing field in database

萝らか妹 提交于 2019-12-22 18:59:06

问题


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 ?


回答1:


Are you using attr_accessible? If so, add :is_public to the list.



来源:https://stackoverflow.com/questions/5032922/rails-getting-undefined-method-for-existing-field-in-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!