S
S
Smilez Gray2016-02-04 13:26:24
HTML
Smilez Gray, 2016-02-04 13:26:24

What is the correct way to use tags for ruby ​​code in HTML?

In what cases is the <%= %> tag used to process ruby ​​code in html , and in which <% %> ?
Is it possible to write several lines of ruby ​​code in one tag, or only line by line enclosing in tags?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mlwrm, 2016-02-04
@Smilez-Grey

Smilez Gray <%= %> tag is used in cases where you want to insert something (the value of some variable). For example value="<%= @reserved_name %>", the value of the @reserved_name variable will be substituted, or so:
the <% %> tag is used in other cases, for example, to enclose a ruby ​​expression in it

<%10.times do%> 
<p> Hello world! </p> 
<%end%>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question