handlebars_assets icon indicating copy to clipboard operation
handlebars_assets copied to clipboard

Cannot find partials

Open mehulkar opened this issue 10 years ago • 1 comments

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'."

mehulkar avatar May 22 '14 19:05 mehulkar

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

AlexRiedler avatar Sep 08 '14 22:09 AlexRiedler