Skip to content

Instantly share code, notes, and snippets.

@solars
Created March 4, 2011 15:25
Show Gist options
  • Save solars/854755 to your computer and use it in GitHub Desktop.
Save solars/854755 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'sinatra'
require 'dm-core'
require 'dm-migrations'
DataMapper::setup(:default, "sqlite3://#{File.expand_path(File.dirname(__FILE__))}/tmp/participants.db")
class Participant
include DataMapper::Resource
property :id, Serial
property :email, String
property :event, String
end
DataMapper.auto_upgrade!
post '/participants' do
Participant.new(:email => params[:email], :event => params[:event]).save
"<span stype='padding:20px'>Thank you, you will be notified!</span>"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment