i have an image uploads implementation finished for my bookmarks app https://harrisonsbookmarks.netlify.app
i can write full docs for it as well but here is a quick summary:
- from the client side you need to change your form to encType="multipart/form-data" to allow for the form to deal with files
- you add the file to state via an
onChange
handler - when the form is submitted you create a form data object that is sent in the body of the POST
- all of this code can be found here https://github.com/CoderAcademy-MEL/ft-bookmarks-client/blob/master/src/components/CreateBookmark.jsx
- the create action then receives the params and creates the bookmark
- rails has active storage tables setup and a bookmark has_one_attached image