I\'m learning Rails, and i\'m doing a exercise which i have to mix some html with ruby in a view file.
What is the main difference between \" <%= #code %> \" and \" &
<%= 1 + 2 %> will evaluate AND display the result. In this case, you should see 3 in your view.
<%= 1 + 2 %>
<% 1 + 2 %> will evaluate but will not display the result in the view. In this case, you will not see 3 in your view.
<% 1 + 2 %>