Live Reload for Rails

Have you ever wanted to make changes in your Rails app and immediately see the changes in Browser?

If so, you can consider using Live Reload Rails feature.

Install Live Reload Ubuntu

sudo apt-get install python-livereload

Install Chrome extension

https://chrome.google.com/webstore/detail/livereload

Enable http fecth in settings

or Use rack

https://github.com/johnbintz/rack-livereload

Start live reload

livereload ~/projects/project-name/app

Add guard-livereload

group :development do
  gem 'guard-livereload', require: false
end

Initialize guard

bungle exec guard init

Add to Guardfile

guard 'livereload' do
  watch(%r{app/views/.+\.(erb|haml|slim)$})
  watch(%r{app/helpers/.+\.rb})
  watch(%r{public/.+\.(css|js|html)})
  watch(%r{config/locales/.+\.yml})
  # Rails Assets Pipeline
  watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html|png|jpg|scss))).*}) { |m|     "/assets/#{m[3]}" }
end

Rub guard

bundle exec guard
rails, live reload, feature
or subscribe via RSS with Feedly!

Need help with your digital project