-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.rb
43 lines (32 loc) · 828 Bytes
/
app.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
#encoding: utf-8
require 'rubygems'
require 'sinatra'
require 'sinatra/reloader'
get '/' do
erb "Hello World of Mine! <a href=\"https://github.com/bootstrap-ruby/sinatra-bootstrap\">Original</a> pattern has been modified for <a href=\"http://rubyschool.us/\">Ruby School</a>"
end
get '/about' do
erb :about
end
get '/visit' do
erb :visit
end
post '/visit' do
user_name = params[:username];
user_phone = params[:userphone];
user_date = params[:userdate];
barbername = params[:barbername]
combined_data = "#{user_name} - #{user_phone} - #{user_date} - #{barbername}\n\n"
users_file = File.open "public/visits.txt", "a" do |file|
file.write(combined_data)
file.write "\n"
end
@message = "Complete"
erb :thankyou
end
get '/contacts' do
erb :contacts
end
get '/thankyou' do
erb :thankyou
end