cowboyd / handlebars.rb

Ruby Bindings for Handlebars.js
http://www.handlebarsjs.com
160 stars 68 forks source link

helperMissing no longer called for 0-arity helpers #17

Open hypomodern opened 11 years ago

hypomodern commented 11 years ago

According to http://handlebarsjs.com/expressions.html, "A Handlebars helper call is a simple identifier, followed by zero or more parameters", which was the case as of handlebars.rb 0.3.2.

I had added a custom "helperMissing" helper to my Handlebars::Context subclasses that made use of this feature for simple property lookup on the object. As of 0.4.0, this no longer works: the helperMissing helper is simply not invoked unless there are one or more parameters supplied.

Here's a link to a commit on my project that illustrates this.

Is this by design, and the handlebars docs are outdated? Or is this a bug?

devknoll commented 9 years ago

It's a regression in Handlebars 1.3.0. The handlebars-source gem needs to be updated to 2.0.