Hello, I’ve run into a problem. I am trying to use a data array for a table on my page. I get a syntax error when I try to do it. I’m using haml for the syntax of my html files and yml for the data file.
%table.table.table-striped
%thead
%tr
%th List of Services
%th Price
%tbody
- data.services.services.each do |service|
%tr
%td=service.item
%td=service.price
From: source/index.html.haml
services:
- item: "Operating System Maintenance"
price: "$20"
From data/services.yml
The error I get or some variant if I move the “data” line around.
SyntaxError at /
/www/html/root/middleman/project2/source/index.html.haml:41: syntax error, unexpected keyword_ensure, expecting keyword_end /www/html/root/middleman/project2/source/index.html.haml:45: syntax error, unexpected end-of-input, expecting keyword_end end;end;end;end ^
Please help, I’d really like to utilize this feature.