Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 42 lines (31 sloc) 0.453 kb

Sequel

Require the Sequel gem in your app:

require 'rubygems'
require 'sinatra'
require 'sequel'

Use a simple in-memory DB:

require 'sqlite3'
DB = Sequel.sqlite

Create a table:

DB.create_table :links do
  primary_key :id
  varchar :title
  varchar :link
end

Create the Model class:

class Link < Sequel::Model; end

Create the route:

get '/' do
  @links = Link.all
  haml :links
end
Something went wrong with that request. Please try again.