Skip to content

Instantly share code, notes, and snippets.

View joemusacchia's full-sized avatar

Joe Musacchia joemusacchia

View GitHub Profile
@joemusacchia
joemusacchia / ReactCarrierwaveImageUploadBlogPost.md
Last active February 7, 2022 02:46
Upload images with React and the carrierwave Ruby gem for Rails 5

Upload images with React and the carrierwave Ruby gem for Rails 5

I recently attended a 4.5 month, intensive coding bootcamp in Boston, MA called Launch Academy. I spent a lot of time in academic science doing imaging research, so I naturally had an interest in learning how to manipulate images in this new web browser environment. For my capstone project, I created a very simple image editing Rails app where I realized I needed to be able to save/upload images to my database.

Since, through earnest effort, I wanted my app to use React for a single-page experience, and I quickly discovered that my desire to use a React/fetch/carrierwave/fog/Rails strategy was initially difficult to learn. I had to pull information from many sources (StackOverflow, Medium, official docs, other blog posts, course instructors, etc) to develop a method that uses this specific POSTing cycle.

This blog post represents my findings to integrate all these technologies in a modern, seamless