Open RavenXce opened 7 years ago
do..end
# _partial.json.builder json.bar do json.buzz '42' end # no new line after this
# new.json.builder json.foo do json.partial! 'foo/partial', locals: {} end
# in foo controller: def new gom.jbuilder end
json variable gon.foo.bar.buzz = 42 is assigned.
gon.foo.bar.buzz = 42
Exception thrown: SyntaxError - syntax error, unexpected end-of-input, expecting keyword_end Stacktrace:
SyntaxError - syntax error, unexpected end-of-input, expecting keyword_end
gon (6.1.0) lib/gon/jbuilder/parser.rb:70:in `block in parse_source' jbuilder (2.6.3) lib/jbuilder.rb:18:in `initialize' jbuilder (2.6.3) lib/jbuilder/jbuilder_template.rb:15:in `initialize' jbuilder (2.6.3) lib/jbuilder.rb:23:in `encode' gon (6.1.0) lib/gon/jbuilder/parser.rb:69:in `parse_source' gon (6.1.0) lib/gon/jbuilder/parser.rb:25:in `parse!' gon (6.1.0) lib/gon/jbuilder.rb:18:in `handler' gon (6.1.0) lib/gon.rb:96:in `jbuilder' ...
Adding a new line at the end of the partial stops the error from happening.
Steps to reproduce:
do..end
block:Expected result:
json variable
gon.foo.bar.buzz = 42
is assigned.Actual result:
Exception thrown:
SyntaxError - syntax error, unexpected end-of-input, expecting keyword_end
Stacktrace:Notes:
Adding a new line at the end of the partial stops the error from happening.