2011-03-15 4 views
0

내 코드에서 timeOffsets라는 해시를 만듭니다.Ruby json gem은 html 엔티티를 인코딩합니다.

그리고 to_json을 사용하여 자바 스크립트로 렌더링합니다.

timeOffsets=<%[email protected]_json%>; 

하지만 HTML 엔티티 인코딩으로 얻을 수 있습니다.

timeOffsets={&quot;Introduction_to_Lists&quot;:0,&quot;Removing_elements&quot;:693,&quot;Joining__join_&quot;:1490}; 

HTML 엔티티 인코딩을 중단하려면 어떻게해야합니까?

+0

루비인가 레일인가? – Techism

답변

4
timeOffsets=<%=raw @timeOffsets.to_json%> 

원시보기 도우미를 사용하십시오.

+0

같은 출력이 업데이트되었습니다. 죄송합니다. – bcoughlan

+0

이 업데이트되었습니다. –

+0

완벽한 명성! – bcoughlan

관련 문제