No commit activity in last 3 years
No release in over 3 years
Handles uploads for you, using your app's Active Storage configuration.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.7, < 3.0.0
= 11.0.1
>= 3.0.0, <= 4.0.0
>= 4.9.0, <= 5.0.0
= 5.12.2
= 4.2.0
>= 10.0.0, <= 14.0.0
>= 1.4.0, <= 2.0.0
>= 4.0.0, <= 5.0.0

Runtime

>= 5.2.0, < 7.0.0
>= 2.0.0, <= 3.0.0
>= 5.2.0, < 7.0.0
 Project Readme

Godmin Activestorage

Gem Version

Godmin Activestorage is a file upload component for Godmin that uses Active Storage for uploads.

Installation

Add the gem to the application's Gemfile:

gem "godmin-activestorage"

Or to the admin engine's gemspec:

s.add_dependency "godmin-activestorage", "~> x.x.x"

Require the gem's stylesheet and javascript:

 *= require godmin
 *= require godmin-activestorage
//= require godmin
//= require godmin-activestorage

Usage

See the Active Storage documentation for info on how to configure storage location, set up your model etc. Once that is done, require godmin-activestorage in your application.js and application.css.

Then, simply use the uploader in your form like so:

<%= form_for(@resource) do |f| %>
  <%= f.input_field :title %>
  <%= f.text_field :body %>

  <%= f.uploader :attachment, preview: true, remove: false %>
<% end %>

The preview option should only be used for image attachments.

By setting remove: false the uploader's remove image action is hidden.

(Lack of) Direct uploads

This gem is supposed to be a drop-in replacement for godmin-uploads which uses refile. But unlike that gem, godmin-activestorage does not yet support direct uploads. Image files can be previewed but the actual upload won't happen until the form is submitted. There's great support for direct uploads inside Active Storage, we just haven't been able to make them work within the Godmin engine yet.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/varvet/godmin-activestorage. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

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

Code of Conduct

Everyone interacting in the Godmin::Activestorage project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Contributors

https://github.com/varvet/godmin-activestorage/graphs/contributors