Skip to content

Instantly share code, notes, and snippets.

View savroff's full-sized avatar

Nick Savrov savroff

View GitHub Profile
module Inertiable
extend ActiveSupport::Concern
included do
before_action :inertiable
end
def inertiable
response.set_header('Vary', 'Accept')
response.set_header('X-Inertia', true) if inertiable?
@savroff
savroff / gist:1c8593fdcd3327748613
Last active March 3, 2017 15:21
Resumable uploading with plupload
// If you want to create resumable uploading for your chunks plupload uploader
// you need to go in plupload.dev.js on line 1419 in xhr.onload function
// and change this part:
offset += curChunkSize;
file.loaded = Math.min(offset, blob.size);
// to this:
offset += curChunkSize;