I am new to web development. As the title states, I have been having an issue with my JS in Heroku. I am using ruby on rails 5.1 and when I push my project to Heroku master everything is working fine but the JavaScript. I have been googling this for the last 2 days. I have tried organizing the //= require etcetc, have tried modifying my code, have tried changing config.assets.compile = false to true and have tried like 4 to 5 different results here in StackOverflow, like(Javascript features work on localhost but not when deployed to Heroku). Really don't know what else can I do. Here is my application.js
//= require jquery
//= require rails-ujs
//= require turbolinks
//= require jquery.easing
//= require bootstrap-sprockets
//= require creative
//= require_tree .
$(document).on('turbolinks:load', function() {
// Offset for Main Navigation
$('#mainNav').affix({
offset: {
top: 50
}
});
$("#button-transform").click(function() {
$('.transform').toggleClass('transform-active');
});
window.setTimeout(function() {
$("#flash").fadeTo(2500, 0).slideUp(1750, function()
{
$(this).remove();
});
}, 3000);
});
Please let me know if you need more info.
Thanks