Reputation: 2908
My javascript is not making it to my heroku app even though my application.html.haml file has:
= javascript_include_tag "application"
. I threw in an alert to check if any js is making it there but no cigar. I also checked in firebug and the javascript isn't being sent to the browser what-so-ever. Any ideas?
application.js
//= require jquery
//= require jquery_ujs
//= require_tree .
//= require jquery_nested_form
//= require jquery-fileupload
//= require autoNumeric
//= require lightbox
alert('test?');
Production.rb
MyMyApp::Application.configure do
config.force_ssl = true
config.cache_classes = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = true (I tried false)
config.assets.compress = true
config.assets.compile = true
config.assets.digest = true
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
end
ruby '2.0.0'
gem 'rails', '3.2.13'
Upvotes: 3
Views: 1161
Reputation: 76774
2 things:
-> Try to call when document is ready
$(document).ready(function() {
alert('hello');
});
-> Try to precompile assets before pushing to Heroku:
in your production.rb:
config.serve_static_assets = true
config.assets.compile = true
in your cmd:
> rake assets:precompile
> git push heroku master
Upvotes: 0
Reputation: 5421
There are many problems with asset pipeline and heroku. Check this linke
https://devcenter.heroku.com/articles/rails-asset-pipeline
Or simply put into config/application.rb line:
config.assets.initialize_on_precompile = false
This should solve your problems cheers.
Upvotes: 1