Skip to content

Instantly share code, notes, and snippets.

#Make sure the postgres App is running on computer
#Carrierwave works with ORM such as Active Record and Datamapper;
rails new carrier_wave_app -d postgresql
add production and development database to database.yml #make sure you do not add one of the fields to production
rails g scaffold art_galleries name:string location:string avatar:text #Also create the table in migrations folder;
#Is it added to the protected attributes method in the controller;
#Add root_to in the config.routes;
gem 'carrierwave'
rails generate uploader Avatar #Give you a class in app/uploaders/avatar_uploader.rb
rails g migration add_avatar_to_art_galleries avatar:string
@codingricky
codingricky / dius_bowling.md
Last active December 13, 2018 04:33
DiUS Bowling Exercise

DiUS is starting a bowling club. To help with the club, we have engaged you to program a scoring system.

The features on the system are:

  • One player only
  • In each frame, the bowler has 2 tries to knock down all the pins
  • If in 2 tries, the bowler fails to knock down all the pins, their score is the sum of the number of pins they've knocked down in the 2 attempts

E.g, if a bowler rolls, 4,4

@ryandotsmith
ryandotsmith / a-backbone-js-demo-app-sinatra-backend.md
Created January 22, 2012 01:42
Backbone demo app with sinatra backend

A Backbone.js demo app (Sinatra Backend)

Oct 16 2010

Updates

  • 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments

In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].