leshill / handlebars_assets

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

undefined method `to_json' for #44

Closed NiQ-B closed 11 years ago

NiQ-B commented 11 years ago

Getting this error: undefined method `to_json' for #String:0x000001015e2188

After setting HandlebarsAssets::Config.ember = true.

in rvm/gems/ruby-1.9.3-p194/bundler/gems/handlebars_assets-7ac9c4b12a26/lib/handlebars_assets/tilt_handlebars.rb:32:in `evaluate'

leshill commented 11 years ago

Hi @niquelbarron,

Odd, are you using Rails?

NiQ-B commented 11 years ago

No,

Sinatra,

Hamlbars 2.0

Trying to precompile via Rake task. On Jan 2, 2013 4:59 PM, "Les Hill" notifications@github.com wrote:

Hi @niquelbarron https://github.com/niquelbarron,

Odd, are you using Rails?

— Reply to this email directly or view it on GitHubhttps://github.com/leshill/handlebars_assets/issues/44#issuecomment-11826273.

leshill commented 11 years ago

Hi @niquelbarron,

Yea, that is a bug — I will fix later, a pull request would be faster :) The fix might be as easy as using dump instead of to_json.

leshill commented 11 years ago

Hi @niquelbarron,

Try the ember_without_rails branch and let me know that if it works for you.

leshill commented 11 years ago

Hi @niquelbarron, @tobiaswerner,

Has anyone tried the branch yet? Once I get confirmation from a real app that it works, I will merge and push the gem.

tobiaswerner commented 11 years ago

@leshill thanks for your response. I will give it a try when time permits...

//edit @niquelbarron @leshill I tried the branch in my rack-based application and all went fine.

NiQ-B commented 11 years ago

@leshill https://github.com/leshill Looks great. No hamlbars errors either!

Thanks!

On Sun, Jan 13, 2013 at 2:08 PM, Les Hill notifications@github.com wrote:

Hi @niquelbarron https://github.com/niquelbarron, @tobiaswernerhttps://github.com/tobiaswerner ,

Has anyone tried the branch yet? Once I get confirmation from a real app that it works, I will merge and push the gem.

— Reply to this email directly or view it on GitHubhttps://github.com/leshill/handlebars_assets/issues/44#issuecomment-12198301.

leshill commented 11 years ago

Hi @niquelbarron and @tobiaswerner ,

Thanks, merged into master.

Fixed by ce79ce18.