如何使用rails控制台检查数据库的条目?

时间:2021-09-01 20:44:58

I use rails 4 with mysql and have a table named items. I run rails generate model

我使用带有mysql的rails 4并有一个名为items的表。我运行rails generate model

rails generate model items

I want to check if this model is indeed been mapped to the database table so I ru

我想检查这个模型是否确实映射到数据库表,所以我ru

Items.find(1)

and getting

bash: syntax error near unexpected token `1'

1 个解决方案

#1


3  

Run rails console, then try Item.find(1)

运行rails console,然后尝试Item.find(1)

#1


3  

Run rails console, then try Item.find(1)

运行rails console,然后尝试Item.find(1)