Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
cheba opened this Issue · 1 comment

2 participants

@cheba

A few examples of odd behavior.

The template for our experiments:

template = Ember::Handlebars::Template.new {}
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.

@tchak
Collaborator

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.