내가 4 응용 프로그램 내 레일에 JS를 addthis (smartlayers)를 통합하려고 turbolinks 추가레일이 통합
난 두 페이지 예 (쇼 템플릿, 템플릿 수정) 내가 탐색에 코드를 추가
한 페이지에서 다른 페이지로 링크를 사용하여 작동하는 아이콘을 볼 수 없습니다
페이지를 새로 고침 할 때 아이콘을 볼 수 있습니다. 그리고 나는 googled했다. 그리고 나는 페이지가 turbolinks를 항해하기 위해 사용하는 선로에서 발견했다.
나는 this에서 해결책을 시도했지만 해결할 수 없습니다.
여기에, 그것은 단지 몸을 잡는 것, Turbolinks 완전히 페이지를 다시로드하지 않기 때문에 그것의, 내 편집 템플릿
<h1>Editing product</h1>
<%= render 'form' %>
<%= link_to 'Show', @product %> |
<%= link_to 'Back', products_path %>
<!-- Go to http://www.addthis.com/get/smart-layers to customize -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5270a69567915956"></script>
<script type="text/javascript">
addthis.layers();
</script>
<!-- AddThis Smart Layers END -->
<!-- AddThis Button END -->
내 쇼 템플릿 나도이 문제를 가지고
<p id="notice"><%= notice %></p>
<p>
<%= image_tag @product.photo.url(:medium) %>
</p>
<p>
<strong>Title:</strong>
<%= @product.title %>
</p>
<p>
<strong>Sku:</strong>
<%= @product.sku %>
</p>
<p>
<strong>Description:</strong>
<%= @product.description %>
</p>
<p>
<strong>Price:</strong>
<%= @product.price %>
</p>
<%= button_to 'Add to cart', line_items_path(:product_id => @product), :class =>"btn btn-success" %>
<%= link_to 'Edit', edit_product_path(@product) %> |
<%= link_to 'Back', products_path %>
<!-- AddThis Smart Layers BEGIN -->
<!-- Go to http://www.addthis.com/get/smart-layers to customize -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5270a69567915956"></script>
<script type="text/javascript">
addthis.layers();
</script>
<!-- AddThis Smart Layers END -->
답장을 보내 주셔서 감사합니다. 다른 사람들 (예 : google analytics)에서도 동일한 전략을 사용하고 있지만 추가 스마트 계층을 위해 작동하지 않습니다 –
AddThis와 관련된 모든 코드를 포함하도록 질문을 편집 할 수 있습니까? –