batman-rails-flo
Live-reload your batman.js app with fb-flo
.
Features
- Live reloading Models, Controllers and Views
- Live reloading HTML templates
- Live reloading CSS
- Fires
liveReload
onMyApp
so you can define custom handlers
Also, any class on MyApp
can implement the class method liveReload(className, newCodeString)
, where:
-
className
is the class that was reloaded -
newCodeString
is a bunch of JavaScript to beeval
'd to load the new class.
Installation
Get the fb-flo
Chrome extension.
Add this line to your application's Gemfile:
gem 'batman-rails-flo'
And then execute:
$ bundle
Add the client code to your batman.js app's Sprockets manifest:
#= require batman/live_reload
Also, if your app isn't in the /assets/batman folder, you will need to set the pathToHTML variable here so that it knows where to find your views.
Batman.config.pathToHTML = '/assets/html'
Run the live-reload server
You'll need node.js. Execute:
$ bundle exec rake batman:live_reload
And re-connect with the fb-flo
plugin if necessary
Known Issues
- You have to reload after adding new files
Contributing
- Fork it ( https://github.com/[my-github-username]/batman-rails-flo/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request