Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README should specify how to add assets path outside of Rails #13

Closed
bloudermilk opened this issue Feb 11, 2012 · 2 comments
Closed

README should specify how to add assets path outside of Rails #13

bloudermilk opened this issue Feb 11, 2012 · 2 comments

Comments

@bloudermilk
Copy link
Contributor

Hey guys,

Firstly, thanks for the time you've invested in this gem. It really simplified the process of getting Handlebars in a my Sinatra app.

I had one problem, though, and that was informing my Sprockets::Environment instance of the asset path supplied by this gem. I eventually got it working after delving into the source code, but it's quite a hack:

handlebars_path = HandlebarsAssets::Handlebars.send(:assets_path).join("javascripts")
environment.append_path(handlebars_path)

How did you guys intend for the asset path to be included? Let me know and I'll be happy to update the README to include instructions and send a pull request.

@leshill
Copy link
Owner

leshill commented Feb 16, 2012

Hi,

Yea, that is a problem — Rails knows how to pull things out of vendor/assets. The assets_path above is really only used to get the handlebars.js code for execjs to run the compiler.

What seems to be the accepted way to do this is to have a path available off of the top module Handlebars, @josh does that here: https://github.com/josh/ruby-modernizr .

Perhaps you could make that change and then document it.

@bloudermilk
Copy link
Contributor Author

I figured that would be the solution. I'll work on this some time this week and issue a pull request with the new method and an updated README.

@bloudermilk bloudermilk mentioned this issue Feb 17, 2012
@leshill leshill closed this as completed Jul 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants