This is the demo application for our Rails Workshop, a yearly event held by makandra to tell students about the Ruby on Rails framework and test-driven development.
The application was inspired by the wonderful emergency compliment service. You should make that website your homepage and buy all their prints.
This repository contains the same application multiple times, in different stages of development. As we move along the stages, we add more and more functionality.
This stage shows a very simple Rails application with a single route, a single controller and no model.
routes.rb
: Our routes setup file. This maps incoming browser requests to controller actions.
compliments_controller.rb
: Our one and only controller. It fetches a compliment and puts it into an instance variable @compliment
.
stage-02: Model / View / Controller interaction
: Moves controller code into a Ruby model Compliment
stage-03: Database access with ActiveRecord : Moves compliments into the database.
stage-04: ActiveRecord validations and form helpers : You can now submit your own compliments.
stage-05: ActiveRecord associations : Introduces ratings for compliments.
stage-06: Test-driven development : Introduces Cucumber tests and RSpec tests for the functionality above.
-
Install Ruby. See the official installation instructions. If you're on Linux or OS X we recommend RVM. If you're on Windows we recommend Ruby Installer.
-
Copy this repository to your hard drive. You can use Git or simply download as ZIP.
-
You can now
cd
into each stage folder, install dependencies and start a Rails server:cd stage-01 bundle rails server
-
You can now access the application under http://localhost:3000.
-
Once you're done (or want to switch to a different stage), press
CTRL+C
inside your server terminal to stop your server.