No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Sinatra Active Record Starter Kit

This template provides a basic Sinatra application that includes:

Getting Started

# Clone down this template
git clone <YOUR_APP_NAME>

# Move into your app's directory

# Install all the gems
bundle install

# Remove the old git history and start your own
rm -rf .git && git init && git add -A && git commit -m 'Initial commit'

Configuring Your Database

This template is set up for using a PostgreSQL database. You will need to create a config/database.yml. There is an example at config/database.example.yml.

Once you've created a config/database.yml, you can create your database with rake db:create.

Rake Tasks

This template uses the sinatra-activerecord gem, which provides the following rails-like rake tasks:

rake db:create            # create the database from config/database.yml from the current Sinatra env
rake db:create_migration  # create an ActiveRecord migration
rake db:drop              # drops the data from config/database.yml from the current Sinatra env
rake db:migrate           # migrate the database (use version with VERSION=n)
rake db:rollback          # roll back the migration (use steps with STEP=n)
rake db:schema:dump       # dump schema into file
rake db:schema:load       # load schema into database
rake db:seed              # load the seed data from db/seeds.rb
rake db:setup             # create the database and load the schema
rake db:test:prepare      # Prepare test database from development schema