Skip to content

A plugin to upload and preview Carrierwave attachments in Administrate

License

Notifications You must be signed in to change notification settings

neumayr/administrate-field-carrierwave

This branch is up to date with zooppa/administrate-field-carrierwave:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7ac3503 · Mar 29, 2023

History

84 Commits
Jan 7, 2022
Apr 13, 2019
Oct 11, 2018
Apr 13, 2019
Dec 27, 2021
Sep 6, 2018
Jan 9, 2022
Mar 2, 2018
Jan 9, 2022
Dec 27, 2021
Jan 7, 2022
Oct 11, 2018
Oct 11, 2018
Oct 11, 2018
Mar 2, 2018
Mar 29, 2023
Oct 11, 2018
Jan 9, 2022

Repository files navigation

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.

About

A plugin to upload and preview Carrierwave attachments in Administrate

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 77.4%
  • HTML 22.6%