forked from code61/sinatra_c3s3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.rb
More file actions
36 lines (26 loc) · 681 Bytes
/
app.rb
File metadata and controls
36 lines (26 loc) · 681 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require 'sinatra'
require 'csv'
get '/' do
erb :index
end
get '/todo' do
@todos = ['Order canapes', 'Confirm event details with attendees', 'Book band']
erb :todo
end
get '/schedule' do
@schedule = [ ['8pm', 'Doors open'],
['8.30pm', 'Champagne and canapes served'],
['9pm', 'Speech'],
['9.30pm', 'Painting unveiled'],
['9.40pm', 'Live band plays'] ]
erb :schedule
end
get '/rsvps' do
@rsvps = CSV.read('rsvps.csv')
@acceptances = []
@rejections = []
@acceptance_count = 0
@rejection_count = 0
# TODO categorise rsvps into acceptances/rejections and count them
erb :rsvps
end