0

I am using Rails 4, ruby 2, and jbuilder gem to respond json.

I have a file index.json.jbuilder in which following code is written

json.partial! "apis/contents", comments: @comments
json.name @name

Returning following error :-

no implicit conversion of String into Integer
Nishutosh Sharma
  • 1,926
  • 2
  • 24
  • 39

1 Answers1

0

I think it might be due to the collection of objects, you can define partial explicitly, like this:

json.partial! partial: 'apis/contents', collection: @comments, as: :comment
MayankJ
  • 446
  • 3
  • 15