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.

Home Page:http://garrettbjerkhoel.com/json_builder/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Key names can't match Rails helper method names

lagartoflojo opened this issue · comments

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.

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.

Nice, thanks! =)