Rails Tags
There are two variations on the Rails tags that you can place into Rails HTML Embedded Ruby (ERb) template files. The ones you’ve used so far include an equal sign in the opening delimiter: <%=.
These tags cause Rails not only to evaluate Ruby expressions but also to display the results in a web page. If you omit the equals sign from the opening delimiter, then the code will be evaluated, but the result will not be displayed: <%.
Note
ERb files contain a mix of HTML markup and Ruby code between tags such as <%= and %>. Rails processes these files before the final pages are displayed in the web browser, executing the embedded Ruby and constructing the HTML page as a result.
If you want, you can place quite long pieces of code—your entire ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access