问题
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