-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.rb
32 lines (21 loc) · 763 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
# app.rb
require('sinatra')
require('sinatra/contrib/all') if development?
# CARE: if you add a new controller, you MUST add it below!
require_relative('./controllers/accounts_controller.rb')
require_relative('./controllers/categories_controller.rb')
require_relative('./controllers/transactions_controller.rb')
require_relative('./controllers/vendors_controller.rb')
# this will be the home page for the whole app
# thus 'index'
# not sure whether to keep this blank or just go straight to
# 10 most recent transactions instead.
p "This is process #{Process.pid}"
get '/' do
@transactions = Transaction.select_all()
@categories = Category.select_all()
@accounts = Account.select_all()
# erb(:index)
redirect to("/transactions")
end
# app.rb