-
Notifications
You must be signed in to change notification settings - Fork 21
c9.io saasbook walkthrough.md
Paul McCulloch edited this page Mar 16, 2014
·
9 revisions
- 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
- 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
- Add http://pastebin.com/UQTR5UQh to myrottenpotatoes/Gemfile, not in a group: [p 104]
# 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