There are now several ways to manage javascript files and depending on how your Rails app was set up, the javascript folder may be somewhere else. This app appears to use Webpacker hence /app/javascript/. GitHub - rails/webpacker: Use Webpack to manage app-like JavaScript modules in Rails which doesn’t acknowledge the /javascript folder. You’ve found a major problem with Rails at the moment. Rails struggles with how to deal with JavaScript. A short history would be Sprockets, Webpacker and now Rails ES6 based replacement for webpacker - #2 by juansecaro, a post written by the creator of Rails, DHH.
Webpack VS Sprockets - The Lean Software Boutique will give you an idea of what’s involved. Since Webpacker is relatively new people have different approaches on how to implement it and you’ve discovered that. Many good posts and YouTube tutorials have been done about Webpacker in Rails, but they all seem to take slightly different approaches and the official documentation hasn’t kept up.
I don’t know Rails that well but did get caught up in the Webpacker a year or two ago. And maybe my naive post will generate other posts that will help you.
Good luck.