diff --git a/README.md b/README.md index 45af2d6d..b88ec67a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ You can see an example of how to use the gem [here](https://github.com/keithpitt Add the gem to your application Gemfile: - gem "ember_rails" + gem "ember-rails" Run `bundle install` and add the following line to `app/assets/javascripts/application.js`: diff --git a/lib/ember-rails.rb b/lib/ember-rails.rb index 7baa3fdf..c9b113f8 100644 --- a/lib/ember-rails.rb +++ b/lib/ember-rails.rb @@ -1 +1,20 @@ -require 'ember_rails' +require 'sprockets' +require 'sprockets/engines' + +require "ember_rails/handlebars/source" +require "ember_rails/handlebars/template" + +module EmberRails + class Engine < ::Rails::Engine + config.handlebars = ActiveSupport::OrderedOptions.new + config.handlebars.precompile = Rails.env.production? + config.handlebars.template_root = 'templates' + config.handlebars.template_path_separator = '/' + + initializer :setup_ember_rails, :group => :all do |app| + app.assets.register_engine '.handlebars', EmberRails::Handlebars::Template + app.assets.register_engine '.hbs', EmberRails::Handlebars::Template + app.assets.register_engine '.hjs', EmberRails::Handlebars::Template + end + end +end diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb index a4d2c116..68425e4c 100644 --- a/test/dummy/config/application.rb +++ b/test/dummy/config/application.rb @@ -5,7 +5,7 @@ require 'sprockets/railtie' Bundler.require -require "ember_rails" +require "ember-rails" module Dummy class Application < Rails::Application