ERB is simply a language that allow HTML and pure Ruby code to co-exist together.
<% #any ruby code %>
This is the syntax that will allow you to build a ruby code, but will not display it.
<%= #any ruby code %>
This will display the ruby code.
ERB will have access to any instance variable that is given by the sinatra code.
<% #any ruby code %>
This is the syntax that will allow you to build a ruby code, but will not display it.
<%= #any ruby code %>
This will display the ruby code.
ERB will have access to any instance variable that is given by the sinatra code.
Comments
Post a Comment