Profile picture (or any file) uploading with Grape + Trailblazer + CarrierWare

12-Nov-2016 3729

Assume that you have a Grape API (in fact it can be a Rails API or anything else, not the point) with something like Angular.JS for the frontend. As a modern Ruby developer you already using (or want to) Trailblazer for business logic encapsulation. And now you need to upload profile picture for the authenticated users. First question is: what to use for pictures uploading? My choice in most cases falls on the known and classic solution in the Ruby community — CarrierWave gem. It is a flexible and powerful library for uploading and processing files with support of various storages.

Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle