When I run the app locally, everything works fine. I only have 3 javascript files in the app:
app/assets/javascripts/application.js
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require bootstrap
//= require_tree .
app/assets/javascripts/social_posts.js
//= require moment/moment
moment is located at vendor/assets/javascripts.
app/assets/javascripts/social_posts_actions.js.coffee
console.log 'hello'
# Format post dates
format_post_dates = ->
$('time.moment').each ->
dt = moment($(this).attr('datetime'))
dtstr = dt.format('h:mm A')
if dt.dayOfYear() != moment().dayOfYear()
dtstr = dt.format('MMM Do, ') + dtstr
$(this).html dtstr
return
return
add_edit_click_listener = ->
$('.edit-social-post-action').click ->
$('#socialPostMessage').val $(this).data 'message'
$('#socialPostImageUrl').val $(this).data 'image-url'
$('#myModal').modal()
return
return
# Add Handlers for the edit action
$(document).ready ->
console.log 'hello doc.ready'
add_edit_click_listener()
return
When I view the source on heroku it shows my comments and console.log calls being updated in the javascript source but nothing is being executed.
Additionally, if I try calling moment() (one of the included libraries) from the console, the function isn't available.
I've tried pre-compiling my assets locally before pushing to heroku and that's not solving the problem.
This is rails 4