Skip to content

Instantly share code, notes, and snippets.

@grantspeelman
Last active February 16, 2016 06:58
Show Gist options
  • Save grantspeelman/13d8915d70cdbf5fb594 to your computer and use it in GitHub Desktop.
Save grantspeelman/13d8915d70cdbf5fb594 to your computer and use it in GitHub Desktop.
Build and house/resident registry using scaffolds

Build a Simple rails app using scaffolds

Model Design

House
  Date Built (date)
  Address (string)
  City (string)
  Active (boolean)
  
Resident
  Belongs to (House)
  Full Name (string)
  Date of Birth (date)
  ID Number (string)
  Room Number (integer)

Commit 1 (Rails new)

  • git init
  • create a new rails app
  • add rails-spec gem
  • use sqlite as database

Commit 2 (generate House Scaffold)

  • generate house scaffold
  • make sure all crud actions work

Commit 3 (generate resident scaffold)

  • generate resident scaffold
  • needs to be nested resource of houses

Bonus points

  • Capybara Tests
  • 100% Test Coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment