A bootstrap styled single file uploader for refile with progress bar and image preview.
Add this line to your application's Gemfile:
bundle install and restart your server to make the files available through the pipeline.
//= require refile ):
//= require bootstrap_refile
Add this line to your stylesheet:
<%= form_for @user do |form| %> <%= form.bootstrap_attachment_field :profile_image, direct: true %> <% end %>
If you want to change the style of the progress bar you can pass it in:
<%= form_for @user do |form| %> <%= form.bootstrap_attachment_field :profile_image, direct: true, progress_class: 'progress-bar-danger' %> <% end %>
The filename field for Refile is required for this to work, so make sure to add it to your tables.
Another note, this is my first gem, so it's probably pretty awful, if you have a problem open an issue and and let me know if you know how to fix it.