-
Notifications
You must be signed in to change notification settings - Fork 3
/
yardsale.rb
67 lines (53 loc) · 1.13 KB
/
yardsale.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
# setup.rb makes sure we're setting up our environment correctly, i.e.,
# requiring the necessary gems, connecting to the correct database, etc.
require './setup'
# database.rb is where we're defining our DataMapper models
require './database'
# The home page
get '/' do
erb :index
end
## Listings
# Show a specific listing
get '/listings/:id' do
erb :show_listing
end
# Show a "new listing" form
get '/listings/new' do
erb :new_listing
end
# Create a new listing
post '/listings' do
end
# Show an "edit existing listing" form
get '/listings/:id/edit' do
erb :edit_listing
end
# Update an existing listing
put '/listings/:id' do
end
# Delete an existing listing
delete '/listings/:id' do
end
## Categories
# Show all listings in a given category
get '/categories/:id' do
erb :show_category
end
# Show a "new category" form
get '/categories/new' do
erb :new_category
end
# Create a new category
post '/categories' do
end
# Show an "edit existing category" form
get '/categories/:id/edit' do
erb :edit_category
end
# Update an existing category
put '/categories/:id' do
end
# Delete an existing category
delete '/categories/:id' do
end