Today I Learned

hashrocket A Hashrocket project

Configure ngrok with Rails Server in development

TIL about the RAILS_DEVELOPMENT_HOSTS env variable. This adds the hosts specified to your environment, so that you don't have to manually update config.hosts.

Just start your server like so

$ RAILS_DEVELOPMENT_HOSTS="my-url.ngrok-free.app" bin/rails s

h/t Matt Polito

See More #rails TILs
Looking for help? Hashrocket has been an industry leader in Ruby on Rails since 2008. Rails is a core skill for each developer at Hashrocket, and we'd love to take a look at your project. Contact us and find out how we can help you.