Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


configuration.handlebars.templates_root doesn't work like root #34

cheba opened this Issue · 1 comment

2 participants


A few examples of odd behavior.

The template for our experiments:

template = {}
Rails.configuration.handlebars.templates_root = 'app'
t.send :template_path, 'app/templates/app/example' # => "templates/example"

In previous example you can see that all instances of app directory removed, not only the root one.

Rails.configuration.handlebars.templates_root = 'app/templates'
t.send :template_path, 'app/templates/app/example' # => "app/templates/app/example"

In last example root is not removed at all.


yep probably bad naming... Or need to rethink this option. The original use case was not to remove root, but a folder somewhere in the path. In my app I use it like this :

Rails.configuration.handlebars.templates_root = 'templates'
t.send :template_path, 'app/templates/example' # => "app/example"

I understand, that this is confusing and will fix it
The best option is to make it behave as 'root'

@tchak tchak closed this issue from a commit
@tchak tchak fix #34 b7f131d
@tchak tchak closed this in b7f131d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.