I've been looking around for a solution to this question for the last couple of days. It's a simple annoyance, but I hate not knowing how to do things...
Environment: Ruby, Rails, rhtml
The Problem: When I iterate a collection in rhtml I would like to reduce the number of <% %> and <%= %> tags I use. The following seems bloated:
<% @products.each do |p| %>
<%= @p.name %>
<% end %>
EDIT: how do I exclude <%= %> inside of a block?
I would much rather do:
<% @products.each do |p|
puts @p.name
end %>
Certain situations could allow for use of either... However, I know that I could do this with jsp:
<% for(int i=0; i<10;i++){
System.out.print(i);
} %>
Thanks in advance for your input.