Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: a01a8eef5d
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (22 sloc) 0.437 kB

Sequel

Require the Sequel gem in your app:

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

Use a simple in-memory DB:

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
Jump to Line
Something went wrong with that request. Please try again.