json_controller.rb 198 B

1234567
  1. class JsonController < ApplicationControllerMetal
  2. def index
  3. add_headers
  4. self.content_type = 'application/json'
  5. self.response_body = Oj.dump({ 'message' => 'Hello, World!' })
  6. end
  7. end