ruby - How to use rails Paperclip to upload images without using a form helper -


i know paperclip gem rails can upload images server this.

<%= form_for @object, :method => :post, html: { multipart: true }  |f| %>    <%= f.file_field :image %>  <% end %>  

but since using reactjs, want pure html file upload. have been trying way:

<form classname="new_object" id="new_object" enctype="multipart/form-data" action="/objects" method="post">                <input classname="upload" type="file" name="object[image]" id="object_image" />  </form> 

every time upload image paperclip::adapterregistry::nohandlererror in objectscontroller#create error.

at point don't know problem is, great !

i found solution problem, in part mohamed. had encode file uploaded base64 using javascript, had submit value though hidden input field.

then started working !


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -