Sha256: b812542b6d61d5fae85f917225af9a211b8d9ca32e32fe2803ce37921458e504
Contents?: true
Size: 761 Bytes
Versions: 5
Compression:
Stored size: 761 Bytes
Contents
# frozen_string_literal: true module Alchemy module Admin module UploaderResponses extend ActiveSupport::Concern def successful_uploader_response(file:, status: :created) message = Alchemy.t(:upload_success, scope: [:uploader, file.class.model_name.i18n_key], name: file.name) { json: {message: message}, status: status } end def failed_uploader_response(file:) message = Alchemy.t(:upload_failure, scope: [:uploader, file.class.model_name.i18n_key], error: file.errors[:file].join, name: file.name) { json: {message: message}, status: :unprocessable_entity } end end end end
Version data entries
5 entries across 5 versions & 1 rubygems