Browse Source

use JSON.generate to generate JSON for JSON benchmark rendering plain string in JSON (#6887)

Daniel 3 years ago
parent
commit
52496d83ec
1 changed files with 1 additions and 1 deletions
  1. 1 1
      frameworks/Ruby/rails/app/controllers/hello_world_controller.rb

+ 1 - 1
frameworks/Ruby/rails/app/controllers/hello_world_controller.rb

@@ -11,7 +11,7 @@ class HelloWorldController < ApplicationController
   end
 
   def json
-    render json: { message: 'Hello, World!' }
+    render json: JSON.generate({message: 'Hello, World!'})
   end
 
   def db