Erb with Sinatra in ruby
- by JP
So I have a webserver I've built using sinatra, the meat of which goes like this:
set :variable,"value"
get '/' do
erb :index
end
And, of course, the template in views/index.erb which looks something like this:
<html>
<!-- etc -->
<ul>
<% my_array.each do |thing| %>
<%="Something: #{thing}, variable from…