dewski / json_builder

Rails provides an excellent XML Builder by default to build RSS and ATOM feeds, but nothing to help you build complex and custom JSON data structures. JSON Builder is here to help.
http://garrettbjerkhoel.com/json_builder/
MIT License
244 stars 52 forks source link

Key names can't match Rails helper method names #10

Closed lagartoflojo closed 12 years ago

lagartoflojo commented 12 years ago

When using keys that match Rails helper method names, like:

dom_id "le-dom-id"
url_for "le-url"

JSONBuilder calls the Rails helper methods instead of generating a key with the corresponding value. Using key :dom_id, "le-dom-id" does not work either.

dewski commented 12 years ago

I have pushed up a fix for this and released a new version along with #8 and #9, it's now at 3.0.3.

You must use key :dom_id, "le-dom-id" or key dom_id("le-dom-id"), true.

lagartoflojo commented 12 years ago

Nice, thanks! =)