Pass a Block on Console Load
Have some Ruby code you want to run as the Rails console loads? Here's a technique.
In this example, I'm going to use a function from the hirb gem. Add the gem to your Gemfile and bundle
.
Next, pass a block to console
in your application configuration.
The next time you start the Rails console, Hirb.enable
will run after load.