-
Notifications
You must be signed in to change notification settings - Fork 4
/
app.rb
51 lines (37 loc) · 1.21 KB
/
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
44
45
46
47
48
49
50
51
require "sinatra/base"
require "erubis"
module Brug
class Application < Sinatra::Base
set :public, File.expand_path('../public', __FILE__)
set :views, File.expand_path('../views', __FILE__)
set :environment, "production"
enable :sessions
before do
session[:lang] = params[:lang] if params[:lang]
session[:lang] = 'en' unless session[:lang]
end
get '/' do
@menu = "about"
erubis "about.#{session[:lang]}".to_sym, :layout => "layout.#{session[:lang]}".to_sym
end
get '/leaflet_ruby_muni' do
erubis "leaflet".to_sym, :layout => "layout_leaflet".to_sym
end
get '/activities' do
@menu = "activities"
erubis "activities.#{session[:lang]}".to_sym, :layout => "layout.#{session[:lang]}".to_sym
end
get '/projects' do
@menu = "projects"
erubis "projects.#{session[:lang]}".to_sym, :layout => "layout.#{session[:lang]}".to_sym
end
get '/members' do
@menu = "members"
erubis "members.#{session[:lang]}".to_sym, :layout => "layout.#{session[:lang]}".to_sym
end
get '/blog' do
@menu = "blog"
erubis "blog.#{session[:lang]}".to_sym, :layout => "layout.#{session[:lang]}".to_sym
end
end
end