I\'m using JBuilder as to return some JSON. I have a index.json.jbuilder that generates the data, and I need to render it to a string. However, I\'m not sure ho
index.json.jbuilder
From console:
view = ApplicationController.view_context_class.new("#{Rails.root}/app/views") JbuilderTemplate.encode(view){|json| json.partial!('path/to/index', @my_object) }
via https://github.com/rails/jbuilder/issues/84#issuecomment-38109709