https://github.com/hyperoslo/refile-input
Refile support for Formtastic
https://github.com/hyperoslo/refile-input
Last synced: about 1 year ago
JSON representation
Refile support for Formtastic
- Host: GitHub
- URL: https://github.com/hyperoslo/refile-input
- Owner: hyperoslo
- License: mit
- Created: 2015-02-02T14:52:22.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-03-14T20:27:26.000Z (over 10 years ago)
- Last Synced: 2024-08-10T11:08:20.892Z (almost 2 years ago)
- Language: Ruby
- Homepage:
- Size: 6.84 KB
- Stars: 8
- Watchers: 13
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this 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:
``` ruby
gem "refile-input", require: ["inputs/refile_input"]
```
Use the gem:
``` ruby
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](https://github.com/elabs/refile/). 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](https://github.com/elabs/refile/#4-rails-helpers).
* all formtastic's options such as `hint`, `label`, etc.
# License
[MIT](LICENSE.txt)