更新时间:2023-02-12 18:04:43
你的模型是@Messages
,改成@message
.
像你应该使用迁移一样改变它:
To change it like you should use migration:
def change
rename_table :old_table_name, :new_table_name
end
当然不要手动创建该文件,而是使用 rails 生成器:
Of course do not create that file by hand but use rails generator:
rails g migration ChangeMessagesToMessage
这将在 'db
目录中生成名称具有正确时间戳的新文件.然后运行:
That will generate new file with proper timestamp in name in 'db
dir. Then run:
rake db:migrate
从那时起您的应用应该没问题.
And your app should be fine since then.