attachinary
attachinary copied to clipboard
Problem with No JS version.
I don't want fancy stuff. So, I am using
<div class="form-group">
<%= f.label :pic %>
<%= f.file_field :pic, accept:'image/*', class:'form-control' %>
</div>
In the view. In Model, I've
has_attachment :pic
validates :pic, presence: true
I've also specified Strong parameters
params.require(:post).permit(:pic)
But, whenever I try to upload, I get the error pic cannot be blank, though I've selected a file.
How can I achieve this? Also how do I upload to a specific folder?
Hi @AmitJoki,
Can you please provide the relevant code from your controller, and the HTML generated from your ERB code? Please also refer to the sample code which uses the simple_form gem.