Reputation: 5323
json.votes answer, answer.votes.count throw 0 is not a symbol nor a string
json.votes answer, answer.votes.count
0 is not a symbol nor a string
Also try json.votes answer, answer.votes.count.to_s throw undefined method '0' for #<Answer:0x00000004699a98>
json.votes answer, answer.votes.count.to_s
undefined method '0' for #<Answer:0x00000004699a98>
Application code
Upvotes: 0
Views: 292
Reputation: 176
Try json.votes answer.votes.count
json.votes answer.votes.count
Upvotes: 2