wxmn / CloudinaryHerokuDemo

An demo setup for Cloudinary setup on Rails & Heroku

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cloudinary Heroku Demo

Deploy

This demos a snippet of JavaScript that'll delay a forms submission to the server until all files have finished uploading. I've also written an accompanying blog post about it.

I've also included a Carrierwave setup that worked for me (which also adds tags the remote uploads), along with a fairly rudimentary test.

Setting Up

Heroku

Create the app and add the Cloudinary addon

heroku create && heroku addons:create cloudinary:starter

Adding the buildpacks for Heroku (So it installs JavaScript dependencies, then bundles)

heroku buildpacks:set heroku/ruby && heroku buildpacks:add --index 1 heroku/nodejs

Local Environment

Installing JavaScript dependencies (Via Yarn)

brew install yarn && yarn

Copy the example database and environment files

cp config/database.yml.example config/database.yml && cp .env.example .env

Setup the database

bundle exec rails db:setup

Getting the CLOUDINARY_URL environmental variable (I'm assuming you've run the Heroku setup at this point)

heroku config -s | grep CLOUDINARY >> .env

Turning on the server

bundle exec rails s

Running Tests

bundle exec rails test

About

An demo setup for Cloudinary setup on Rails & Heroku


Languages

Language:Ruby 74.3%Language:HTML 17.8%Language:JavaScript 6.0%Language:CSS 1.6%Language:Shell 0.3%