سؤال

My AddThis (http://www.addthis.com/social-plugins#.Uma2k7_h0b0) plugin normally shows locally but when I deploy my application on Heroku, it doesn't show.

This is the code which I use for AddThis plugin:

<script type="text/javascript">$(document).ready(function() {
    var script = 'http://s7.addthis.com/js/300/addthis_widget.js?domready=1#pubid=xxx';
    if (window.addthis){
        window.addthis = null;
        window._adr = null;
        window._atc = null;
        window._atd = null;
        window._ate = null;
        window._atr = null;
        window._atw = null;
    }
    $.getScript( script, function() {
        addthis.layers({
            'theme' : 'transparent',
            'share' : {
            'position' : 'left',
            'numPreferredServices' : 5
            }   
        });
    });
});
</script>

And my application.js looks like this:

//= require jquery
//= require jquery.ui.all
//= require jquery_ujs
//= require bootstrap
//= require fullcalendar
//= require moment.js
//= require turbolinks
//= require_tree .

Thank you.

هل كانت مفيدة؟

المحلول

Make sure you have your assets precompile for production after changing/created a java script file

rake assets:precompile RAILS_ENV=production

or you have appropriate setting in your config/production.rb

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top