EDIT: It looks like for whatever reason my assets are not loading. My javascript is returning me 404 errors on the server.
ORIGINAL: I know jQuery loads when I run the app on my localhost because; 1. my app works, and 2. the following code also tells me jQuery is loading when the page loads.
if (typeof jQuery != 'undefined') {
// jQuery is loaded => print the version
alert(jQuery.fn.jquery);
}
The problem is as soon as I push it to Heroku, jQuery doesn't work. The above code doesn't run anymore, and when I try to run $.post( "/time_records", {current_time: current_time}); i get the following error; ReferenceError: $ is not defined
When I run my Bundler on Heroku it says Using jquery-rails (3.1.0)
Application.js
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
GemFile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.2'
# Use postgresql as the database for Active Record
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.1.2'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]