I am using Sinatra and erb on Passenger/Apache. Every time I made edit to the erb file, I have to restart Apache and refresh in the browser.
Is there any way to edit the file and sinatra can instantly update it? I mean simply by clicking the refresh button in the browser can one view the update?
Conclusion:
If you are in dev on sinatra, you can use shotgun or SinatraLoader.
If you are using Passenger, you can create an empty file: tmp\always_restart.txt
Yes, you can use Sinatra::Reloader.
Sinatra::Reloader
Extension to reload modified files. Useful during development, since it will automatically require files defining routes, filters, error handlers and inline templates, with every incoming request, but only if they have been updated.
You can use Shotgun for that: https://github.com/rtomayko/shotgun
Shotgun
This is an automatic reloading version of the rackup command that's shipped with Rack. It can be used as an alternative to the complex reloading logic provided by web frameworks or in environments that don't support application reloading.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With