json_controller.rb 229 B

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