2017-06-14 49 views
0

我試圖使用回形針創建上傳多張圖像,但是當link_ to標籤插入index.html.haml文件時,我遇到了此錯誤。以下是每個文件中的代碼,供您參考。使用回形針將圖像上傳到文檔的不同部分

index.html.haml

- @tags.each do |tag| 
    = link_to (image_tag tag.image.url(:medium)), tag 
    %h2= link_to tag.title, tag 

錯誤消息中的標籤#索引未定義局部變量或者用於#<#方法`haml_temp」

NameError:0x83c728dc>有沒有你意思是? haml_tag

+0

您不正確嵌套的元素請檢查 –

回答

0

測試與驗證碼

- @tags.each do |tag| 
    = link_to tag do 
    = image_tag tag.image.url(:medium) 
    %h2= link_to tag.title, tag 
相關問題