"main"을 포함하기 위해 "if"와 "else"의 whats가 모두 필요합니다. 현재 발생 @transparency
가 정의되어있는 경우, 무엇조건부 haml - else neesting
- if @transparency
#content-inner{:style => "background: url(../../../images/illustrations/" + @transparency + ") no-repeat 88% 50%"}
- else
#content-inner
#main-block
, #main-block
는 #content-inner
안에 중첩되지 않습니다. 그것은 도우미 메서드를 사용하는 중 최선의 여러 해시 속성을 조작, 예를 들어, 더 복잡한 배열을 위해
#content-inner{ :style => @transparency ? "background: url(../../../images/illustrations/" + @transparency + ") no-repeat 88% 50%" : '' }
#main-block
, 또는를 이동 :
같은 게시물로 보입니다 - http://stackoverflow.com/questions/1451794/haml-if-else-error - 비록 그들이 대답 –