leshill / handlebars_assets

Use handlebars.js templates with the Rails asset pipeline.
MIT License
649 stars 159 forks source link

Cannot find partials #97

Open mehulkar opened 10 years ago

mehulkar commented 10 years ago

I'm using the handlbars_assets gem in a Rails 4 + Ember (post 1.0) application and loading handlebars.js v1.3.0

# application.rb
HandlebarsAssets::Config.ember = true
HandlebarsAssets::Config.template_namespace = 'Ember.TEMPLATES'

I have a partial located at app/assets/javascripts/templates/_project_types.hbs. When I load console, I can see _project_types in Ember.TEMPLATES, but I keep getting a Not Found error.

I have tried using it the following ways:

{{partial 'project_types'}}
{{partial '_project_types'}}
{{partial 'projectTypes'}}
{{> '_project_types'}}
{{> 'projectTypes'}}
{{> 'project_types'}}

When I use the {{>}} syntax, an error is thrown from handlebars.js

Uncaught Error: The partial projectTypes could not be found 

When I use the handlebars helper, the error is thrown from ember.js

"Unable to find partial with name '_project_types'."
AlexRiedler commented 9 years ago

@mehulkar would love to fix this; PR's are welcome... is it something to do with how registration occurs? maybe for ember and partials?