0.0
No commit activity in last 3 years
No release in over 3 years
File uploads for the Godmin admin engine for Rails 4+
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0

Runtime

< 2.0, >= 0.9.7
> 0.5.3
 Project Readme

Godmin Uploads

Gem Version

Godmin Uploads is a file upload component for Godmin that uses refile for uploads.

Installation

Add the gem to the application's Gemfile:

gem "godmin-uploads"

Or to the admin engine's gemspec:

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

Require the gem's stylesheet and javascript:

 *= require godmin
 *= require godmin-uploads
//= require godmin
//= require godmin-uploads

Usage

See the refile documentation for info on how to configure storage location, set up your model etc. Once that is done, require godmin-uploads 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.

Contributors

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

License

Licensed under the MIT license. See the separate MIT-LICENSE file.