Skip to content

c9.io saasbook walkthrough.md

Paul McCulloch edited this page Mar 16, 2014 · 9 revisions

Set up custom project in c9.io.

  • We want to use rails 3.2.16 but c9.io default is rails 4.0.0
  • Make a project in c9.io of type Custom.
  • Add a /Gemfile:
   source 'https://rubygems.org'
   ruby '1.9.3'
   gem 'rails', '3.2.16'

bundle install

Section 4.1, p 102

  • Run this variation on the rails new command to use our version of rails. [deviate][p 102]

bundle exec rails new myrottenpotatoes -T

cd myrottenpotatoes

# use Haml for templates
gem 'haml'
# use Ruby debugger
group :development, :test do
  gem 'debugger'
end
  • Add this to it too: [deviate]
gem 'rails', '3.2.16'

bundle install --without production

rails s -b $IP -p $PORT [deviate][p 104]

  • Visit the second, fancy link it prints out. Expect the generic rails welcome page.
  • Add '/movies' to the url and refresh. Expect a rails Routing Error.

rake routes Expect no output: no routes are defined in the new app.

  • Open file log/development.log, observe errors are logged.
  • Add rails CRUD routes by replacing the contents of config/routes.rb with http://pastebin.com/QDjqvSAx:
 Myrottenpotatoes::Application.routes.draw do
  resources :movies
  root :to => redirect('/movies')
end
  • Delete public/index.html

rake routes Expect routes are listed.

  • Visit (your url)/movies again. Expect 'Routing Error uninitialized constant MoviesController' because it's not implemented.
  • Error is logged to log/development.log
Clone this wiki locally