We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 099de03 commit c789b73Copy full SHA for c789b73
server_advanced.rb
@@ -12,11 +12,11 @@ def process_erb(string, req = nil)
12
end
13
14
Dir['views/*.html.erb'].each do |file|
15
- content_string = File.open(file, 'r').read
+ puts "Registering file for server: #{file}"
16
file_name = file.split('/').last.gsub('.html.erb', '')
17
server.mount_proc "/#{file_name}" do |req, res|
18
+ content_string = File.open(file, 'r').read
19
@request = req
-
20
layout_string = File.open('views/layouts/application.html.erb', 'r').read
21
main_contents = process_erb(content_string)
22
res.body = process_erb(layout_string, req) {main_contents}
0 commit comments