refile.
One of features that i like is built in javascript library, which is contains several custom DOM events.
These events also can be listen, so you can provide logic easily around file upload lifecycle process.
" />
Progressbar Upload with Refile Gem
Blog Logo
on
read
There is a ruby gem library for file upload called refile.
One of features that i like is built in javascript library, which is contains several custom DOM events.
These events also can be listen, so you can provide logic easily around file upload lifecycle process.
By default refile provide helpers to built UI element of file input field:
=f.attachment_field:file_field
From that snippet above refile won’t use built in javascript, to enable it just add an option called direct with true.
MORE
=f.attachment_field:file_field,direct:true
Refile provide several events which can attached into form upload element, for attaching the events you can use addEventListener :
Because we focused only progressbar upload, lets construct the form to using twitter bootstrap’s progressbar, currently i’m using slim-template for view.