def create
      upload_io = params[:upload]

      image_name = upload_io.original_filename
      file_path = Rails.root.join('public', image_directory, image_name)

      if File.exist?(file_path)
        @error = I18n.translate('blogo.admin.image_already_exists', image_name: image_name)
      else
        dir = File.dirname(file_path)
        FileUtils.mkdir_p(dir) unless File.exist?(dir)
        File.binwrite(file_path, upload_io.read)
      end

      @image_path = File.join('/', image_directory, image_name)
    end
def create
      upload_io = params[:upload]

      image_name = upload_io.original_filename
      file_path = Rails.root.join('public', image_directory, image_name)

      if File.exist?(file_path)
        @error = I18n.translate('blogo.admin.image_already_exists', image_name: image_name)
      else
        dir = File.dirname(file_path)
        FileUtils.mkdir_p(dir) unless File.exist?(dir)
        File.binwrite(file_path, upload_io.read)
      end

      @image_path = File.join('/', image_directory, image_name)
    end
POST /admin/images

 Upload image.