Skip to content

creatorsschool/sinatra_skeleton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Creators School Sinatra skeleton

This is a very basic setup of a Sinatra app, that already has a model example.

Getting Started

To get started run the following commands:

Install dependencies:

bundle install

Create database:

bundle exec rake db:create

Run migrations to update database schema:

bundle exec rake db:migrate

Whenever you need to update your database (add tables, add columns, etc), you should create a new migration file with the following command:

bundle exec rake db:create_migration NAME=migration_name

migration_name should be replaced with the name you want to give to the migration file.

Note: This app assumes you have sqlite3.

Running the app

To run the app we are using shotgun, which means you can run just by typing shotgun.

Adding some posts

In order to interact with the database you can run tux, which is an interactive shell for Sinatra. Start it by typing tux.

Once in the console, write:

Post.create title: "Some title"
exit

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •