0
我有一個簡單的HTML代碼,需要在Ruby中進行轉換。包裝link_to,image_tag和div_tag生成此代碼的錯誤
<div class="col-md-4 col-sm-6">
<div class="single-work">
<a class="work-thumb mb-35 light-box" href="works/img-05.jpg">
<%= image_tag 'works/img-05.jpg' %>
<div class="work-hover"></div>
</a>
<div class="work-excerp">
<a href="single-services.html"><h2>Plugin Development</h2></a>
<p>Duis autem vel eum iriure dolor in hendrerit in vulpu tate velit esse molestie consequat.</p>
</div>
</div>
</div>
這是我的Ruby代碼。
<div class="col-md-4 col-sm-6">
<div class="single-work">
---> <%= link_to((image_tag'works/img-05.jpg'), image_path('works/img-05.jpg'), 'class' => 'work-thumb mb-35 light-box') %>
<div class="work-hover"></div>
<div class="work-excerp">
<a href="single-services.html"><h2>3D Design</h2></a>
<p>Duis autem vel eum iriure dolor in hendrerit in vulpu tate velit esse molestie consequat.</p>
</div>
</div>
</div>
我需要這個<div class="work-hover"></div>
該標籤內(尋找這一 - >箭頭)
不,不工作。 – manshu
'不工作'幾乎不是一個錯誤的好描述。發生什麼事?它不創建包裝HTML的鏈接? –
我編輯了我的答案。請嘗試此代碼。 –