I'm trying to get a better understanding of how the erb gem works.
So far I've managed to create 2 files: index.html.erb and proc.rb (short for process).
In index.html.erb I have:
<html> <body> erh? <%= "this is a test" %> </body> </html>
require 'erb' template = File.read('index.html.erb') renderer = ERB.new(template) puts renderer.result()
when I run: "ruby proc.rb" I get the following results:
<html> <body> erh? thsdfsdfs this is a test </body> </html>
My question is this: how do I get this to work in the context of a web-server? That is, how can I make it so that when a client requests my webpage it returns index.html which is the processed version of index.html.erb?