为 Ruby on Rails 编写教程。我只是注意到在生成迁移时我拼错了我的列名之一。当我尝试使用关联时,我收到此错误。
first_page = Page.new(:name => "first page", :permalink => 'first', :position => 1)
ActiveRecord::UnknownAttributeError: unknown attribute: position
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.8/lib/active_record/base.rb:1564:in `attributes='
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.8/lib/active_record/base.rb:1560:in `each'
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.8/lib/active_record/base.rb:1560:in `attributes='
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.8/lib/active_record/base.rb:1412:in `initialize'
from (irb):5:in `new'
from (irb):5
>>
我的问题是如何使用职位的正确拼写来更新活动记录。我已经在我的架构文件中更改了它。