Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

limit min and max file size upload #150

Open
gsalin opened this issue Jun 27, 2017 · 2 comments
Open

limit min and max file size upload #150

gsalin opened this issue Jun 27, 2017 · 2 comments

Comments

@gsalin
Copy link

gsalin commented Jun 27, 2017

Hi,

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

Thanks

@fcatuhe
Copy link

fcatuhe commented Jun 30, 2017

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
Copy link
Author

gsalin commented Sep 22, 2017

THanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants