如何设置响应,以便浏览器下载动态生成的 json 数据,而不是显示?
我正在使用活动管理员
member_action :download, :method => :get do
application = Application.find(params[:id])
respond_to do |format|
format.json { render json: application.to_json( include: { categories: { include: { my_cases: { include: [{ questions: { include: :answers } }, :keys ] } } } } ) }
end
end