So I have an HTML file that I am transposing to an ERB view in my Rails app.
However, in the HTML, I have a snippet of JS that has to be run last (after everything else) because it handles the way the page scrolls.
So we have all of the HTML, then right before the </body>, I have this:
<script>
// Some awesome JS that controls the scrollbar
</script>
But I haven't figured out how to make it work within Asset Pipeline, following Rails conventions, properly.
This file is my Home#Index, which is the marketing website for my app for non-logged in users.
If I put this <script> tag at the top of the layout that governs this Home#Index, it doesn't work.
If I move this JS to be inside my app/assets/javascripts/home.js that also doesn't work, because it loads home.js before it loads application.js.
I also don't want to put this inside application.js because it will interfere with other classes throughout the rest of my app that are similarly named.
What's the best RAILSy way to do this without just doing <script>JS</script> inside my app/views/home/index.html.erb, because that just feels wrong.