Ruby on Rails: Reload Script/Console Without Restarting

Contributor Icon Contributed by johnnythawte Date Icon December 6, 2006  
Tag Icon Tagged: Ruby on Rails

When you are testing your rails application using script/console, you have to stop and start the console to test changes to your model objects. This recipe shows you the easy way to reload the console.


If you are using windows, you start the console by using this command: ruby script\console
Linux:./script/console

Just use the following command whenever you make changes to your model objects:
reload!

Here’s an example:
?> reload!
Reloading…
=> [Article, User, ApplicationController]
>>

Previous recipe | Next recipe |
 
blog comments powered by Disqus