2

If I open the Rails Console and create a new Widget:

>> widget = Widget.new
>> widget.name = "Whatever"
>> widget.save

The Widget saves without errors. However, when I run:

>> Widget.all

This new Widget does not appear in the returned list of records. However, if I restart the Rails Console and run the same command again:

>> Widget.all

The Widget now appears in the list of records. Why is this happening? I'm having the same problem with the Rails Server; if I create or edit a Widget with the scaffold views I generated, those Widgets do not appear in the show view until I restart the Rails Server.

By the way, I'm on Windows 7, using RubyMine as my IDE, and using rails 3.2.4 and sqlite3.

4

1 回答 1

0

上面的一位评论者建议我更新到 rails 3.2.11。我更新了 Gemfile 中的版本并运行bundle update,这解决了问题。我不知道更新前哪个宝石或它们的组合是问题。

于 2013-01-25T18:27:34.573 回答