Giter Site home page Giter Site logo

picandocodigo / administrate-field-paperclip Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 13.0 32 KB

Paperclip field plugin for Administrate

Home Page: https://rubygems.org/gems/administrate-field-paperclip

License: MIT License

Ruby 93.61% HTML 6.39%
administrate rails paperclip

administrate-field-paperclip's People

Contributors

klaseskilson avatar pedantic-git avatar picandocodigo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

administrate-field-paperclip's Issues

HasManyPaperclip

Hey

I know it's edge case (or maybe not), but I have the following structure:

I have an Attachment model, where is :data is the paperclip attachment.
But this model belongs to polimorphically to a concern, called Attachmentable

Attachmentable defines has_many to attachments.
And I have several models, which includes Attachmentable.

So, I need somehow to integrate paperclip to administrate.
Cant use has many, or polymorphic, or paperclip field types.
I need all of them for one field.

There is maybe a solution to use with your gem?
Or can be this a valid feature request?

Thanks

Rails 5.1 support?

Greetings,

Would you consider relaxing the requirement for Rails < 5.1? I'd like to use this gem with the latest Rails.

Thank you,
--Michael

Deleting an attachment

Hi --

I was about to go add support for deleting an attachment, but not sure what approach makes the most sense.

For any other field type (text/etc), the current value gets rendered to the form and you can edit it out to communicate to the controller that you want to unset it.

For file field types, the current value doesn't really get rendered. We can render the attachment URL or image out of band, but it's not native to the input type. There doesn't appear to be a way to populate the input with an 'unset' type value, so there's no clear way to communicate to the controller in a standard way to unset the attribute.

The best practice appears to be to render a 'delete'/'unset' checkbox or similar, and check for that value in the controller. However, this would require the controller to cooperate with the field's custom checkbox semantics, which breaks the nice abstraction we have with fields in Administrate.

Thoughts?

Ankur

Other file types

Hello I am trying to use this with my project and one model has an attachment that can be a video or an image, can this be integrated? And if so should I create a PR if I get something working soon?

Thank you

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.