RoR に移行する前は、この優れたjQuery カウントダウンを使用していましたが、問題なく動作していました。Rails (4.0.8) アプリケーションで再度使用しようとしましたが、何も表示されない理由がわかりません。
私は app/assets/javascripts (とりわけ) にあります:
application.js
jquery.countdown.min.js
jquery-2.1.1.min.js
私の application.js で:
//= require_tree .
//= require jquery-2.1.1.min
//= require jquery.countdown.min
私のGemfileで:
gem 'jquery-rails', '3.0.4'
私の app/views/pages/page.html.erb で:
<br />
--
<div data-countdown="2016/01/01"></div>
--
<script type="text/javascript">
$('[data-countdown]').each(function() {
var $this = $(this), finalDate = $(this).data('countdown');
$this.countdown(finalDate, function(event) {
$this.html(event.strftime('%D days %H:%M:%S'));
});
});
</script>
このページに記載されているようですが、何も表示されません。
明らかな何かが欠けていますか?ご協力いただきありがとうございます。