I’m using Rails script/console to learn REST routes. It is very handful!
In order to do that I need to paste these two lines every time I run console:
include ActionController::UrlWriter
default_url_options[:host] = 'whatever'
If there is any way to make a script which will add this automatically every time I run console?
A bit of a hack but you could put two calls in a
.rbfile andrequirethat when you start the console.E.g.