How do I pass an instance variable to an erb template in a Sinatra route. The below doesn't work.
get '/' do
@beercompany = "Coors"
erb :mytemplate
end
mytemplate.erb
<h1> Hello from <% @beercompany %></h1>
output doesn't show beercompany's name
Hello from
You need to put = to display the variable:
<h1> Hello from <%= @beercompany %></h1>