leshill / handlebars_assets

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

Handlebars_assets does not work on Rails 4 #72

Closed peleteiro closed 11 years ago

peleteiro commented 11 years ago

Someone needs to test if it works on Rails 3.x.

I've just checked how ember-rails fixed that and did the same.

https://github.com/emberjs/ember-rails/blob/8d1b909df76041b436385cf7d1d67cd76ddd86ea/lib/ember/rails/engine.rb

AlexRiedler commented 11 years ago

I know I had issues with the old code in Rails 3.1; so I am sure it is better than what was there... however would still be nice to verify :) :+1:

leshill commented 11 years ago

Hi @peleteiro, @AlexRiedler,

I just created the following simplistic Rails 4 app without your PR and everything is working as expected. Do you mind forking that app and getting the app to fail for you?

@metaskills reported a similar issue in a Rails 3 app with issues #70 and #73 . I believe there is a problem, but am not sure where it lies (handlebars_assets or elsewhere) and need a failing example to work with.

Thanks!

leshill commented 11 years ago

Closing until we can get a failing example to work with.

AndyMoreland commented 11 years ago

In a hackathon at the moment so I don't have time to fork the repo and all that but I can confirm that it fails with out of the box rails 4.

AndyMoreland commented 11 years ago

I had to reproduce the pull request in config/application.rb to get anything to work.

leshill commented 11 years ago

Hi @AndyMoreland,

Interesting. Please post your Gemfile.

You can see in this Rails 4 repo that it does work. I suspect another gem is doing something unexpected, but I need an example :|

AndyMoreland commented 11 years ago

Here is my gemfile: https://gist.github.com/AndyMoreland/6097584

ralphcrisostomo commented 11 years ago

I fixed my problem with handlebars_assets by renaming my hamlbars from "template.html.hamlbars" to "template.hamlbars"

"template.html.hamlbars" works on rails 3+ and does not work on 4 "template.hamlbars" does not work no 3+ and works on 4

Just correct me if I am wrong. It works for me :)

Cheers!