No commit activity in last 3 years
No release in over 3 years
A bootstrap styled single uploader for refile.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0

Runtime

>= 3.1
>= 0
 Project Readme

Bootstrap Refile

A bootstrap styled single file uploader for refile with progress bar and image preview.

Installation

Add this line to your application's Gemfile:

gem 'bootstrap_refile'

bundle install and restart your server to make the files available through the pipeline.

Add this line to your javascript file ( after //= require refile ):

//= require bootstrap_refile

Add this line to your stylesheet:

@import "bootstrap_refile";

Usage

<%= 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 %>

Options:

  • progress_class
  • remove_class
  • select_class

Note:

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.