attachinary icon indicating copy to clipboard operation
attachinary copied to clipboard

Problem with No JS version.

Open AmitJoki opened this issue 10 years ago • 1 comments

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?

AmitJoki avatar Apr 06 '15 15:04 AmitJoki

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.

tocker avatar May 11 '15 13:05 tocker