Sending <input type=“image”> to a folder on the server

后端 未结 2 1622
一个人的身影
一个人的身影 2020-12-22 06:27

I have this code

<%= form_for(:img, url: {action: \"postodb\"}) do |f| %>
image here!
<%= f.submit \"Se
2条回答
  •  执念已碎
    2020-12-22 06:44

    First what your should to do is read a docs: http://www.w3schools.com/Tags/att_input_type.asp

    image - Defines an image as the submit button.

    Second what your should learn to read is logs. At screenshot you have section with params, and there is no data_uri key.

    And finaly use the for upload. If you want beauty async upload with preview, you should look on jquery-file-upload gem instead.

    P.S.: type='image' is a submit button with image.

提交回复
热议问题