ruby on rails - print information to page using yml data file using Middleman / ERB -
given data file containing title, age, , description tag how go printing these out individually? i've tried using simple;
<% data.folder.to.file.example.title %>
and blank should be, no error.
whereas using loop on list defined in same data file works fine;
<% data.folder.to.file.example.list.each |l| %> <li> <%= f %> </li> <% end %>
i guess put list, want know how better use these data files middleman setup. aim able create static pages via middleman's proxy generate pages end using data in yml files of same name. i'm halfway there think - taking looping example add [proxyname] after example , selects correct yml file.
help , pointers appreciated!
in example used <% data.folder.to.file.example.title %>
evaluate expression not print out.
instead using <%=
print out expression output file e.g. <%= data.folder.to.file.example.title %>
Comments
Post a Comment