Make sure that you start your local rails server like this rails s -b 0.0.0.0 — thereby binding correctly.
This is based on original work by @wnstn as well as his blog post.
Make sure that you start your local rails server like this rails s -b 0.0.0.0 — thereby binding correctly.
This is based on original work by @wnstn as well as his blog post.
| var gulp = require('gulp'); | |
| var browserSync = require('browser-sync').create(); | |
| var setupWatchers = function() { | |
| gulp.watch(['./app/views/**/*.erb', | |
| './app/assets/javascripts/**/*.js'], ['reload']); | |
| gulp.watch(['./app/assets/stylesheets/**/*.scss'], ['reloadCSS']) | |
| }; | |
| gulp.task('reload', function(){ | |
| return browserSync.reload(); | |
| }); | |
| gulp.task('reloadCSS', function() { | |
| return browserSync.reload('*.css'); | |
| }); | |
| gulp.task('init', function() { | |
| browserSync.init({ | |
| proxy: '0.0.0.0:3000', | |
| port: 8000, | |
| open: false, | |
| ui: { | |
| port: 8001 | |
| } | |
| }); | |
| setupWatchers(); | |
| }); | |
| gulp.task('default', ['init']); |