-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.rb
70 lines (54 loc) · 1.15 KB
/
main.rb
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
require 'sinatra'
require 'mandrill'
def request_res(who, party_size, day, time, contact)
m = Mandrill::API.new
message = {
:subject=> "New Reservation Request",
:from_name=> who,
:text=> [who,party_size,day,time,contact].to_s,
:to=>[{:email=> "[email protected]",:name=> "Carly"}],
:html=> "<html>#{[party_size,day,time].to_s}</html>",
:from_email=> contact
}
sending = m.messages.send message
puts sending
end
get '/' do
@title = "Welcome"
erb :index
end
get '/index' do
erb :index
end
get '/breakfast' do
@title = "Breakfast Menu"
erb :breakfast
end
get '/lunch' do
@title = "Lunch Menu"
erb :lunch
end
get '/dinner' do
@title = "Dinner Menu"
erb :dinner
end
get '/takeout' do
@title = "Take Out"
erb :takeout
end
get '/gallery' do
@title = "Gallery"
erb :gallery
end
get '/reservation' do
@title = "reservation"
erb :reservation, :layout => false
end
post '/new-reservation' do
request_res(params[:who], params[:party_size], params[:day], params[:time], params[:contact])
redirect to '/reservation-made'
end
get '/reservation-made' do
@title = "Reservation Recieved"
erb :resmade, :layout => false
end