0.01
No commit activity in last 3 years
No release in over 3 years
This adds custom input to support refile file uploader to formtastic form builder
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.6
 Project Readme

Refile Input

Refile Input gem adds custom input type to formtastic to use refile file uploader. Well, name is self-explanatory and gem is super-simple. It's built upon refile's input helper.

Installation

Add the gem:

gem "refile-input", require: ["inputs/refile_input"]

Use the gem:

form do |f|
  f.input :image, as: :refile
end

Available options

Gem brings support of the following options:

  • direct determines whether file should be uploaded asynchronously or not. Uploading host might be changed with host option. More about it read in refile documentation. Note that refile's js should be included on the page.
  • image_preview is an option to generate image preview. As arguments it accepts list of refile attachment_url options. Read more here.
  • all formtastic's options such as hint, label, etc.

License

MIT