51
28

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

rails consoleを再読み込みしたい

51
Last updated at Posted at 2014-11-03

rails consoleを再読み込みしたい場合、reload!を使います。

reload!で再読み込み
rails c # rails consoleを起動 

# コードやデータなどを変更

reload!  # 再読み込み

これで最新のモデルデータが読み込まれます。

rails consoleを立ち上げている最中に、モデルの値をGUIから変更した場合、consoleへは即時反映されないです。そのため、値を変更した場合、その度にrails consoleを一旦抜けて再起動をしていました。

再起動なんてしなくていいんですね(;´д`)

51
28
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
51
28

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?