Skip to content

Instantly share code, notes, and snippets.

@schmidp
Created May 4, 2013 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schmidp/5519119 to your computer and use it in GitHub Desktop.
Save schmidp/5519119 to your computer and use it in GitHub Desktop.
Rails 4.0 ember-rails engine.rb
require 'ember/handlebars/template'
require 'active_model_serializers'
module Ember
module Rails
class Engine < ::Rails::Engine
config.handlebars = ActiveSupport::OrderedOptions.new
config.handlebars.precompile = true
config.handlebars.templates_root = "templates"
config.handlebars.templates_path_separator = '/'
config.before_initialize do |app|
Sprockets::Engines #force autoloading
Sprockets.register_engine '.handlebars', Ember::Handlebars::Template
Sprockets.register_engine '.hbs', Ember::Handlebars::Template
Sprockets.register_engine '.hjs', Ember::Handlebars::Template
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment