A little Rails console trick to make you smile
Rails being the wonderful framework that it is, we can execute
rails console from the command-line to enter IRB with our Rails application preloaded.
This allows us to interactively test our code for things like making sure our models have correct associations setup or for quickly creating fancy new records. No need to use the browser. Okay, probably old news…
Well, up till now, every time I made some change in the application code, I’d exit from the Rails console and rerun
rails console just to have the new changes take effect.
Fool that I was!
Instead, I can just run
reload! from inside the Rails console to have the new changes be loaded automatically without having to exit and re-enter.
Doesn’t that make you smile? If not, I present you with a little quote from the Superman:
And those who were seen dancing were thought to be insane by those who could not hear the music.