Running a Rails development firm is great because... 4
you can find yourself saying, “boy, I sure wish that X could do Y.”
15 minutes later… you find that one of your developers has created a solution and then contributed it as a patch to the Rails project.
./script/console
>> reset!
=> []
Yes… this is just a short-cut to Dispatcher.reset_application! ... but it’s saving me a whole 24 characters each time I need to reset my application while hanging out in script/console.
Thanks Jeremy!
Enjoying the content? Be sure to subscribe to my RSS feed.





I prefer the short form,
r!OK, say I’ve got script/server running, and I make a change to enviroment.rb. Does this reset only affect script/console, or will it also change what’s going on in script/server?
great tip, thanks
Phil,
You can certainly call this from
script/server, but we really just wanted a friendly way to reload the app fromscript/console. This is just a wrapper toDispatcher.reset_application!which – as far as I understand – should not affect environment.rb. An olde-fashionedCtrl-C up returnis still required for that. I’m sure you’ve got the reflex by now ;)