Sunday, November 22, 2015

Hello World with a template

#app1.rb
#----------------------

require 'sinatra'

get '/' do

erb :templ

end

__END__

@@templ

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World</title>
</head>
<body>
<h4> Hello World</h4>
</body>
</html>

# at command prompt, run it with ruby app1.rb
# See it on browser

No comments:

Post a Comment