sudhanshu
sudhanshu

Reputation: 462

rails 3.2.9 + ember.js 1.0.0-pre.2 keeps giving template not found error, any clue?

Is there a sample Rails backend + ember.js 1.0.0-pre.2 app to refer. My application is broken after upgrade.

I read about the named handlebars but there seems to be an issue.

If I write in index.html.haml

<script type="text/x-handlebars" data-template-name="application">
    <h1>HI</h1>
</script>

Ember.TEMPLATES has a template named application

if I write a file application.handlebars with same content, I get the error Unable to find template 'application'

Is there any path configuration which has to be done which is missing. Please help.

Upvotes: 1

Views: 684

Answers (2)

sudhanshu
sudhanshu

Reputation: 462

Removed handlebars-assets Gem from Gemfile it used to work till 1.0.pre, it was generating handlebars which were not compatible to Ember code. Ember adds all templates to Ember.TEMPLATES, it was adding into HandlebarsTemplates.

Actually handlebars-assets was never needed. Thanks everyone for help.

Upvotes: 0

Dan Gebhardt
Dan Gebhardt

Reputation: 3281

I'm maintaining an up-to-date Rails / ember example you could reference:

https://github.com/dgeb/ember_data_example

Are you using ember-rails to compile your templates? Of course, you'll also need to require your templates in your application.js if you're using the asset pipeline.

Upvotes: 1

Related Questions