0
你能帮我吗?我不明白如何结合。middleman link_to与image_tag在数据文件yml
我有数据文件。 datafile.yml
list:
- title: "Bar"
desc: "A bar can be classic addition to any home."
image: "images/bar/1.jpg"
id: /bar
这是我的观点:
<% data.categories.list.each do |x| %>
<div id="our-work">
<ul>
<li><a <%= link_to 'Read more', "#{x.id.to_s}.html" %> >
<%= image_tag x.image %>
<div class="overlay">
<summary>
<h2><%= x.title %></h2>
<h3><%= x.desc %></h3>
</summary>
<div class="nnnext"><span></span></div></div>
</a>
</li>
<% end %>
我想创建的link_to +图片标签。在1个字符串中,该怎么做?我希望你明白我的意思。
图像:+ ID:=> <%=的link_to IMAGE_TAG ...%>
链接index.html.erb https://gist.github.com/anonymous/d356271136b1f574965c939a6ba1defb
没有工作:(/家庭/ lucker/git的/厨房画廊/源/ index.html.erb:46:语法错误,意外的')'ore',“#{x.id.to_s} .html”do).to_s; @_out_buf <<'^ /home/lucker/git/kitchen-gallery/source/index.html.erb:59:语法错误,意外的keyword_end,期待')';结束^ /home/lucker/git/kitchen-gallery/source/index.html.erb:113:语法错误,意想不到的keyword_ensure,期待')'确保^/home/lucker/git/kitchen-gallery/source/index。 html.erb:115:语法错误,意外的keyword_end,期待')'结束^ – user2369480
你能否更新问题并共享整个'index.html.erb'? –
问题升级 – user2369480