assembler / attachinary

Attachments handler for Rails that uses Cloudinary for storage.
MIT License
295 stars 129 forks source link

limit min and max file size upload #150

Open gsalin opened 7 years ago

gsalin commented 7 years ago

Hi,

Is it possible to limit minimum and maximum file size upload?

Thanks

fcatuhe commented 7 years ago

Yes possible with form_for:

<%= f.attachinary_file_field :content, cloudinary: { transformation: { width: 200, height: 200, crop: :limit } } %>

But for simple_form, couldn't find a way through class AttachinaryInput < SimpleForm::Inputs::Base, so this is what I did but I'm not proud:

<div class="form-group attachinary required slide_content">
  <%= f.label :content, label: '', class: 'control-label attachinary required' %>
  <%= f.attachinary_file_field :content, cloudinary: { transformation: { width: 200, height: 200, crop: :limit } } %>
</div>
gsalin commented 7 years ago

THanks a lot!