At deliverists.io we build custom software and deliver quality products to our clients. Some time ago, we worked on a project with ClojureScript.
There are many benefits to this language, but today I want to focus on the feature called hot-reload
. The idea is super simple, yet powerful: the web page is reloaded on file save. This small but useful feature saved me a few keystrokes and allowed me to stay focused in the editor while seeing immediate changes in the browser.
As you can see above, without moving out from my editor, the page reloads and I can see the changes immediately! Now… let's replicate that behavior in Ruby on Rails 7.
Let's quickly build a new Ruby on Rails app
gem install rails
rails new test-app --css tailwind
cd test-app
./bin/dev
Then we need to do a few configuration changes:
-
Edit
Gemfile
and addhotwire-livereload
gem:group :development do gem "hotwire-livereload" end
-
Install with bundler
bundle install
-
Run installation
rails livereload:install
-
Install Redis (macOS with Homebrew)
brew install redis
-
Run Redis
brew services restart redis
-
Run Rails
./bin/dev
Edit the file and see the changes!
No more switching windows, hitting F5! That's a live and time saver.
Have fun and keep coding,
Grzegorz, founder of deliverists.io