How do you add Ruby code inside Rails views and have its result outputted in the HTML file?
Create an embedded Ruby file (.html.erb) and surround the Ruby code with <% %>.
<% %>
Insert Ruby code inside standard HTML files and surround it with <% %>. The web server will handle the rest.
Create an embedded Ruby file (.html.erb) and surround the Ruby code with <%= %>.
<%= %>
Put the code in an .rb file and include it in a <link> tag of an HTML file.
<link>