railsware / sht_rails

Shared handlebars templates for Rails 3
http://blog.railsware.com/2012/05/21/shared-handlebars-templates-for-rails-3/
MIT License
76 stars 21 forks source link

Using templates which aren't preceded by an "_" ? #24

Closed 1updesign closed 10 years ago

1updesign commented 10 years ago

Hey!

Guessing this ought to be a simple addition to library? If you can point me in the right direction I'll happily submit a pull request. I have tried myself, but I think I'm missing a few too many fundamentals to go solo here :)

Many Thanks,

Dan

le0pard commented 10 years ago

I am not sure, what understand your problem. "" need to use this templates as rails partials. This templates can work without "" at beginning.

1updesign commented 10 years ago

I have a rails app and an ember app which are in the same repository. I'm trying to use sht_rails to directly access the ember hbs templates for the template directory in my ember-cli app using the following config:

ShtRails.configure do |config| config.template_extension = 'hbs' # change templates namespace in javascript config.template_base_path = File.expand_path('../../../client/app/templates', FILE) end

ember-cli takes handlebars templates as template-name.hbs so it would be ideal to be able to access these. at the moment only files that I rename to _template-name.hbs appear in the global SHT variable for some reason?

Thanks for replying so quickly!

le0pard commented 10 years ago

I think it can be problem, what several handlebars engines try to handle "*.hbs" templates. Also I am not sure, what "sht_rails" templates will work with ember.js.

1updesign commented 10 years ago

ok - I'll check that the templates work when I rename them first and if that is successfull I will get back to you!

Thanks!