Giter Club home page Giter Club logo

trestle-active_storage's Introduction

Trestle Active Storage Integration (trestle-active_storage)

Active Storage integration plugin for the Trestle admin framework

Gem

Usage

Define the active storage fields in your Trestle resource and use the active_storage_field field type:

Trestle.resource(:users) do
  active_storage_fields do
    [:avatar, :profile_picture]
  end

  form do |user|
    text_field :first_name
    text_field :last_name
    active_storage_field :avatar
    active_storage_field :profile_picture
  end
end

You can use the active_storage_field field type for both has_one_attached and has_many_attached attachments.

Installation

These instructions assume you have a working Trestle application. To integrate trestle-active_storage, first add it to your application's Gemfile:

gem 'trestle-active_storage'

Run bundle install, and then restart your Rails server.

Active Storage previews

This plugin shows previews of uploaded files if your system meets the requirements. For more information please consult the Ruby on Rails guides.

If you'd like to get up and running on Heroku, check out their documentation on Active Storage on Heroku. The Ruby on Rails Development Dependencies Install guide outlines how to install the neccessary dependencies to get previews working locally.

TODO / Wishlist

  • Support for has_many_attached attachments
  • Support for Active Storage previews
  • Preview of selected local file (#1)
  • Integration tests

Contributors

Thanks goes out to these wonderful people (emoji key):

Richard Venneman
Richard Venneman

🤔 💻 📖 💬 👀
Aboobacker MK
Aboobacker MK

🤔
Rafael Porto
Rafael Porto

💻
Tom Hoen
Tom Hoen

🐛 💻

This project follows the all-contributors specification.

License

The gem is available as open source under the terms of the MIT License.

trestle-active_storage's People

Contributors

richardvenneman avatar dependabot-support avatar allcontributors[bot] avatar dependabot-preview[bot] avatar punkmaldito avatar hoenth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.