Home

Awesome

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

Contributors

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

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore-start --> <!-- markdownlint-disable --> <table> <tr> <td align="center"><a href="https://www.cityspotters.com"><img src="https://avatars1.githubusercontent.com/u/75705?v=4" width="100px;" alt=""/><br /><sub><b>Richard Venneman</b></sub></a><br /><a href="#ideas-richardvenneman" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/richardvenneman/trestle-active_storage/commits?author=richardvenneman" title="Code">💻</a> <a href="https://github.com/richardvenneman/trestle-active_storage/commits?author=richardvenneman" title="Documentation">📖</a> <a href="#question-richardvenneman" title="Answering Questions">💬</a> <a href="https://github.com/richardvenneman/trestle-active_storage/pulls?q=is%3Apr+reviewed-by%3Arichardvenneman" title="Reviewed Pull Requests">👀</a></td> <td align="center"><a href="http://aboobacker.in"><img src="https://avatars1.githubusercontent.com/u/3112976?v=4" width="100px;" alt=""/><br /><sub><b>Aboobacker MK</b></sub></a><br /><a href="#ideas-tachyons" title="Ideas, Planning, & Feedback">🤔</a></td> <td align="center"><a href="http://euodeiovoce.com.br"><img src="https://avatars2.githubusercontent.com/u/1027961?v=4" width="100px;" alt=""/><br /><sub><b>Rafael Porto</b></sub></a><br /><a href="https://github.com/richardvenneman/trestle-active_storage/commits?author=PunkMaldito" title="Code">💻</a></td> <td align="center"><a href="https://github.com/hoenth"><img src="https://avatars2.githubusercontent.com/u/62977?v=4" width="100px;" alt=""/><br /><sub><b>Tom Hoen</b></sub></a><br /><a href="https://github.com/richardvenneman/trestle-active_storage/issues?q=author%3Ahoenth" title="Bug reports">🐛</a> <a href="https://github.com/richardvenneman/trestle-active_storage/commits?author=hoenth" title="Code">💻</a></td> <td align="center"><a href="https://github.com/basharabdullah"><img src="https://avatars3.githubusercontent.com/u/167290?v=4" width="100px;" alt=""/><br /><sub><b>Bashar Abdullah</b></sub></a><br /><a href="https://github.com/richardvenneman/trestle-active_storage/issues?q=author%3Abasharabdullah" title="Bug reports">🐛</a></td> <td align="center"><a href="https://github.com/McRipper"><img src="https://avatars2.githubusercontent.com/u/58031?v=4" width="100px;" alt=""/><br /><sub><b>Emanuele Barban</b></sub></a><br /><a href="https://github.com/richardvenneman/trestle-active_storage/commits?author=McRipper" title="Code">💻</a></td> <td align="center"><a href="https://github.com/oleg-kiviljov"><img src="https://avatars3.githubusercontent.com/u/10065250?v=4" width="100px;" alt=""/><br /><sub><b>Oleg Kiviljov</b></sub></a><br /><a href="https://github.com/richardvenneman/trestle-active_storage/issues?q=author%3Aoleg-kiviljov" title="Bug reports">🐛</a> <a href="https://github.com/richardvenneman/trestle-active_storage/commits?author=oleg-kiviljov" title="Code">💻</a></td> </tr> </table> <!-- markdownlint-enable --> <!-- prettier-ignore-end --> <!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the all-contributors specification.

License

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