Skip to content

Instantly share code, notes, and snippets.

@kareemgrant
Last active August 29, 2015 14:18
Show Gist options
  • Save kareemgrant/8e8f737ef70ec09b2f35 to your computer and use it in GitHub Desktop.
Save kareemgrant/8e8f737ef70ec09b2f35 to your computer and use it in GitHub Desktop.

Basic ActiveRecord Sinatra

Goals

  1. Understand how to create and access a database with ActiveRecord

  2. See how this database will be used and accessed from your Sinatra application

Assignment

  1. Create a new sinatra app called sinatra_blog and add a database to the app using the steps specified in class. Add a users table to the database with the following fields: email and full_name. Then create a User model in the app that can be used to create (read, update or delete) new user records using activerecord. The assignment will be considered complete when you are able to succesfully create new users in IRB (as specified in class).

  2. VERY IMPORTANT: If you haven't already done so; please ensure that your laptop is correctly set up for Rails development by following the setup instructions found on installrails.com. If this is not completed before next class, you will run into issues and you may fall behind.

Recommended Activity

Read up on HTML forms: http://www.w3schools.com/html/html_forms.asp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment