" appears in some code in the tutorial that I am doing as a delimiter of some built-in ruby, for exa...">

What is the built-in ruby ​​limiter? -%>

" -%> " appears in some code in the tutorial that I am doing as a delimiter of some built-in ruby, for example:

 <% 5.times do |i| -%> <%= thumbnail_tag slideshow.slides[i] %> <% end -%> 

What does it mean? There is nothing in the book (Rails Up and Running)

+6
ruby-on-rails
source share
2 answers

The ERB template language supports <%- and -%> in addition to Ruby code separators <% and %> .

Add a minus to the inside of the space separator from HTML next to the outside of the separator.

+11
source share

In ERB, it removes any new line that follows from the output.

+3
source share

All Articles