So I am a newbie at HAML.
While going through the HAML tutorial the way to represent ruby code was mentioned as =
eg: %strong= item.title
but when I ran this code:
= @list.documents.each do |doc|
%tbody
%tr
%td= doc.display_name
along with all the list data which was displayed there was also alot of junk data displayed which was related to the actual list data which was displayed. This is what I got:
val1 val2 val3 [#Document......@id : val1, @id:val2.....]
When i try the same code while replacing the =
with a -
the unwanted data is not received.
- @list.documents.each do |doc|
%tbody
%tr
%td= doc.display_name
output:
val1 val2 val3
can someone explain the difference between -
and =
while writing ruby code in haml?