2012-05-01 2 views
0

태그에 별도의 단어, 매핑 쓰기, 하나는 내가 렌더링 얻을 수있는 방법을 설명 할 수 .HAML 구문 문제는 내가 HAML 꽤 새로운 오전

는 내가 가진 :

%html{ :itemtype => "http://schema.org"} 

내가 매핑 오류가 발생하지 않고 "의 itemscope"어디에서 추가 할 수 있도록하지 않는 것.

도움 주셔서 감사합니다.

답변

0

렌더링 경우, 모든 한 필요했다 :

%html{itemscope: true, itemtype: "http://schema.org"} 

그 결과 :

<html itemscope itemtype="http://schema.org/"> 
1
부울로 추가하고 서식을 HTML5로 말하는

보십시오 :

engine = Haml::Engine.new '%html{:itemscope => true :itemtype => "http://schema.org"}', :format => :html5 
puts engine.render 

오래된 질문을 다시 방문

<html itemscope itemtype="http://schema.org/"> 
+0

도움 주셔서 감사합니다. 결국 나는 erb를 보통 HTML로 썼다. – veritas1