2017-05-09 30 views
-1

我有一些含有一些元定義的haml文件。 我需要定義像在rails haml文件中使用資產管道

<meta property="og:image" content="path-to/mylogo.png" /> 

Facebook的圖像的元標記我如何能做到這一點與資產管道,我曾嘗試做以下

%meta(property="og:image", content=image_url('newLogo.png')) 

,但它給了我一個錯誤。

+0

試試這個:'%間{內容:IMAGE_URL('newLogo .png'),屬性:「og:image」}' –

回答

1

您沒有使用正確的語法

%meta{ property: "og:image", content: image_url('newLogo.png')}/ 

併爲未來的參考,你可以使用這個在線工具將HTML轉換成HAML - htmltohaml.com