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

后端 未结 2 1611
一个人的身影
一个人的身影 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 <input type='file' ... /> 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.

    0 讨论(0)
  • 2020-12-22 07:00

    Using carrierwave gem for loading images.

    0 讨论(0)
提交回复
热议问题