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

Last line can't be a comment #9

Closed lagartoflojo closed 12 years ago

lagartoflojo commented 12 years ago

A template like this:

name @child.name
# a comment on the last line

breaks with:

(...)/show.json.json_builder:3: syntax error, unexpected keyword_ensure, expecting '}'
(...)/show.json.json_builder:5: syntax error, unexpected keyword_end, expecting '}'

This does not happen if there's at least one empty line after the comment:

name @child.name
# a comment on the last line