Helpers for serving an Ember.js app from Sinatra.
- Pre-compile handlebars templates from separate view files rather than littering them throughout your html.
You can install Sinatra Ember as a Ruby gem. You can install it via gem install
.
$ gem install sinatra-ember
If you use Bundler, add it to your Gemfile.
gem 'sinatra-ember', :require => 'sinatra/ember'
Install the plugin and add some options.
require 'sinatra/ember'
class App < Sinatra::Base
register Sinatra::Ember
ember {
templates '/js/templates.js', ['app/templates/*']
}
end
If you're using the sinatra-assetpack gem, add your served templates to a package.