Embedded ruby “erb” tags [duplicate]
问题 This question already has answers here : What is the difference between <%, <%=, <%# and -%> in ERB in Rails? (7 answers) Closed 5 years ago . I have been going through a crash course of Ruby and Ruby on Rails and i can't figure this out: In embedded ruby html files, there are several tags. <% %> for execution <%= %> for output, but what function do these tags serve: <%= -%>, what's with the "-" sign at the end ? Thanks. 回答1: This link contains a good overview of erb markup. From the site: