Repository is archived
Low commit activity in last 3 years
No release in over a year
A plugin to manage Carrierwave attachments in Administrate
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.14
~> 3.7
~> 13.0
~> 1.1

Runtime

>= 4.2, < 8
 Project Readme

Administrate::Field::Carrierwave

No Maintenance Intended Build status Code Climate


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.


A plugin to upload and preview Carrierwave attachments in Administrate.

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’s master 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 🚨 extend permitted_attributes by remove_FIELD
  • remote_url (default: false): allow uploading files from a remote location. ATTENTION 🚨 extend permitted_attributes by remote_FIELD_url

About

Administrate::Field::Carrierwave is maintained by Zooppa.

See also the list of contributors who participated in this project.