0.0
No release in over a year
Auto reloads Rails applications when assets or views have changed
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

RailsHotreload

This gem adds hot reloading feature to Rails applications that contains hotwire. The application is automatically reloaded when:

  • Any file has changed (added, updated or deleted) in app/assets/builds
  • Any app view has changed (added, updated or deleted) in app/views

Dependencies

Installation

  • Add this line to your application's Gemfile:
group :development do
  gem "rails_hotreload"
end
  • And then execute:
$ bundle install
  • Include this template in your layout
= render '/rails_hotreload/stream' if Rails.env.development?
  • Start the file watcher (Rake task)
bin/rails rails_hotreload:start

Note: If your project is using Procfile.dev (Foreman), then you can add:

rails_hotreload: bin/rails rails_hotreload:start
  • Start your rails application and try editing your views or stylesheets or js files to see immediate changes in your browser

Configuration

bin/rails rails_hotreload:start app/javascripts,app/stylesheets,app/views/
  • The hot reloader UI can be customized as the following:
= render '/rails_hotreload/stream', custom_style: 'left: 20px; bottom: 20px;'

Contributing

Bug reports and pull requests are welcome on https://github.com/owen2345/rails-hotreload. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

To ensure your contribution changes, run the tests with: docker-compose run test

License

The gem is available as open source under the terms of the MIT License.