Sha256: bf11884d2e98e663610dabc0920890c912fff2acd0650bc0750bae70c3e881b7

Contents?: true

Size: 269 Bytes

Versions: 9

Compression:

Stored size: 269 Bytes

Contents

# frozen_string_literal: true

module Uploader
  module JsonRendering
    def render_json(hash_or_object, status = 200)
      self.status = status
      self.content_type = request.format
      self.response_body = hash_or_object.to_json(root: false)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rails-uploader-0.5.9 lib/uploader/json_rendering.rb
rails-uploader-0.5.8 lib/uploader/json_rendering.rb
rails-uploader-0.5.7 lib/uploader/json_rendering.rb
rails-uploader-0.5.6 lib/uploader/json_rendering.rb
rails-uploader-0.5.5 lib/uploader/json_rendering.rb
rails-uploader-0.5.4 lib/uploader/json_rendering.rb
rails-uploader-0.5.3 lib/uploader/json_rendering.rb
rails-uploader-0.5.2 lib/uploader/json_rendering.rb
rails-uploader-0.5.1 lib/uploader/json_rendering.rb