Administrate::Field::Carrierwave
A plugin to upload and preview Carrierwave attachments in Administrate.
IMPORTANT NOTICE
This gem is not actively maintained anymore.
If youβre interested in taking over and steward the project moving forward, please get in touch.
Usage
Add it to your Gemfile
:
gem 'administrate-field-carrierwave', '~> 0.6.0'
Run:
$ bundle install
Add to your FooDashboard
:
ATTRIBUTE_TYPES = {
bar: Field::Carrierwave.with_options(
image: :standard,
multiple: true,
remove: false,
remote_url: false
)
}.freeze
To handle multiple asset uploads, the attribute must point to an empty array in a hash:
# If multiple: true
def permitted_attributes
super - [:bar] + [{ bar: [] }]
end
Options
image
(default:nil
): a version that will be displayed in an<img>
element.multiple
(default:false
): allows uploading of multiple files. ATTENTIONπ¨ : requires CarrierWaveβsmaster
branch. Uploaded files will replace the current ones β if present β and not add to them.remove
(default:false
): allow to remove previously uploaded files. ATTENTIONπ¨ extendpermitted_attributes
byremove_FIELD
remote_url
(default:false
): allow uploading files from a remote location. ATTENTIONπ¨ extendpermitted_attributes
byremote_FIELD_url
About
Administrate::Field::Carrierwave
is maintained by Zooppa.
See also the list of contributors who participated in this project.