The project is in a healthy, maintained state
An enhanced file upload field for Rails forms, powered by web components. Provides drag-and-drop uploads, image/video previews, and seamless ActiveStorage integration.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Project Readme

Bard Attachment Field

An enhanced file upload field for Rails forms, powered by web components. Provides drag-and-drop uploads, image previews, and seamless ActiveStorage integration.

Features

  • Drag-and-drop file uploads
  • Image and video previews
  • Direct uploads to ActiveStorage
  • Multiple file support
  • Form validation (required, accept, size limits)
  • Persists attachments through validation errors

Installation

Add to your Gemfile:

gem "bard-attachment_field"

Usage

In your form:

<%= form.attachment_field :avatar %>
<%= form.attachment_field :documents, multiple: true %>

Options

  • multiple: true - Allow multiple file uploads
  • accept: "image/*" - Restrict file types
  • required: true - Make field required
  • preview: false - Disable image previews
  • disabled: true - Disable the field

License

MIT