我正在使用Slim获取我的观点,并且拥有:
/ = render 'alphabet'
div class="house-list" data-pjax-container="true"
- @houses.each do |house|
= link_to house_path(house)
.picture
= image_tag "http://mylink.com/150/#{house.name.to_s.parameterize}-#{house.location_1.to_s.parameterize}.jpg"
.info
h4 = house.name
p = house.location_1
现在,这是导致问题的link_to行,如果我用普通div
替换它就可以了但是使用link_to导致:
syntax error, unexpected keyword_ensure, expecting end-of-input
关于什么是错的任何想法?
答案 0 :(得分:2)
我很确定在这种情况下您需要将do &block
传递给此link_to
:
= link_to house_path(house) do
.picture
= image_tag "http://mylink.com/150/#{house.name.to_s.parameterize}-#{house.location_1.to_s.parameterize}.jpg"
.info
h4 = house.name
p = house.location_1