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

Can't use Rails helpers #6

Closed lagartoflojo closed 12 years ago

lagartoflojo commented 12 years ago

JSON Builder version 3.0.1 Rails version 3.1.3

Trying to use any Rails helper methods inside the .json_builder template results in errors (JSON::ParserError "unexpected token at"). For example:

# index.json.json_builder file
url root_url
dewski commented 12 years ago

I will publish a new version shortly with a fix for this, I will comment here when I do.

On Nov 28, 2011, at 8:51 PM, Hernán Schmidtreply@reply.github.com wrote:

Trying to use any Rails helper methods inside the .json_builder template results in errors ("unexpected token at"). For example:

url root_url

Reply to this email directly or view it on GitHub: https://github.com/dewski/json_builder/issues/6

lagartoflojo commented 12 years ago

Great, thanks! =)

dewski commented 12 years ago

I fixed this and pushed the gem at 3.0.2. The new addition is here.