Sinatra conventions recap
New:
- Files inside the
publicfolder will be served at the root of the site. This is where stylesheets and images should live.
From before:
- You call a template with the line
erb :template_name - For this to work, you will need a template called
template_name.erbin theviewsfolder. - If you want to share a variable with the template, you need to make it an instance variable,
by starting the variable name with
@ - You can display these shared instance variables by using them inside an erb tag:
<%= @my_variable %>