Rails 4, Heroku, Zurb Foundation 5

I am developing a site using Foundation 5, which I host on Heroku. Yesterday, all javascript-dependent Foundation widgets stopped working on Heroku. In my case, this means all my modals and my slider in orbit. It still works flawlessly on my local machine.

I always precompile my assets (rake assets: precompile) and submit the compiled version before clicking on Heroku with git.

I tried and updated between Foundation versions 5.0.2.0 and 5.0.3.1 and a few other things, but I'm just fixated on where to even get started. I am not too good with javascript debuggning.

Production.rb
  # Disable Rails static asset server (Apache or nginx will already do this).
  config.serve_static_assets = true

  # Compress JavaScripts and CSS.
  config.assets.js_compressor = :uglifier
  # config.assets.css_compressor = :sass

  # Do not fallback to assets pipeline if a precompiled asset is missed.
  config.assets.compile = true

  # Generate digests for assets URLs.
  config.assets.digest = true

  # Version of your assets, change this if you want to expire all your assets.
  config.assets.version = '1.0'

-

application.js
//= require jquery
//= require jquery_ujs
//= require jquery.touchcarousel-1.2.min
//= require foundation
//= require jquery.ui.button
//= require jquery.tap.min
//= require modernizr

//= require jquery-fileupload/basic
//= require_tree .

$(function(){ $(document).foundation(); });

//$('#TjuvkikModal').foundation('reveal', 'open');
//$('#ExempelobjektModal').foundation('reveal', 'open');
+4
1

. , :

$(function(){ $(document).foundation(); });

application.js(. ). applicationato.html script, :

<%= javascript_include_tag "application" %>
<script type="text/javascript">$(function(){ $(document).foundation(); });</script>
</div>

. . script - , application.js. ? ? - , !

+5

All Articles