leshill / handlebars_assets

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

Prefix is not correctly set. #86

Closed larryzhao closed 10 years ago

larryzhao commented 10 years ago

I have a javascript file structure like the following:

--------- app
 |-------- assets
    |-------- javascripts
       |-------- readings.js
       |-------- readings
          |-------- templates
            |-------- contacts.hbs
       |-------- section1.js.coffee
       |-------- section12.js.coffee

reading.js groups everything inside, before I try handlebars_assets in my project, I have //= require_tree ./reading in it which works fine. Now I'd like to import handlebars_assets, I changed it to the following according to the instructions:

//= require ./handlebars.runtime`
//= require_tree ./reading/templates`
//= require_tree ./reading`

It works fine, but the prefixes is still not correctly generated, I still go contacts.hbs compiled into HandlebarsTemplates['reading/templates/contacts']

Is there anything wrong with my javascript manifest?

Thank you very much.

AlexRiedler commented 10 years ago

The javascript manifest does not seem wrong.

What is your prefix used on the configuration options of the gem?

larryzhao commented 10 years ago

I didn't use any, I get that i would figure that out from the instruction, so I didn't tried with that yesterday. I am gonna try it now.

larryzhao commented 10 years ago

It's working now after I set HandlebarsAssets::Config.path_prefix='reading/templates'.