如何在 HAML 中为单个 Ruby 语句使用多行?例如,我想写如下内容:
- entries = [{
- :title => "The Fellowship of the Ring",
- :body => "We should walk instead of fly"
- }]
!!! 5
%html
%head
%title Blog
%body
#content
- entries.each do |entry|
.entry
%h3.title= entry[:title]
%p.body= entry[:body]
但是当然前四行会产生语法错误。