Block nullifies instance variables
lagartoflojo opened this issue · 2 comments
lagartoflojo commented
With code looking like this:
# show.json.json_builder
href @person.href
url do
href @person.href
end
Rails throws:
undefined method `href' for nil:NilClass
Extracted source (around line #3):
1: href @person.href
2: url do
3: href @person.href
4: end
Line 1 works as expected, but @person
is nil in line 3.
dewski commented
This has also been fixed and pushed along with 3.0.2. The issue was the instance variable scope wasn't getting passed down to the other JSON blocks. Thanks for reporting this!
lagartoflojo commented
Thanks! =)
I'll keep reporting anything else I find.