You have a directory called vendor, that is specifically designed for this, and it's rarely talked about and it's used way as it is anymore but this is a directory for third party libraries. Originally, before bundler existed the vendor directory used to save a bunch of copies of your gems in there because you want to use the vendor folder for things you never want to edit, so you want your app directories and all these other directories to just contain the files and code that you write.
//= require sweetalert-dev
*= require sweetalert
Saving that and refreshing the page, it should all be working again but this time you have your third party libraries sectioned off in their nice clean vendor folder, and that's basically what happens when you use a gem. It puts it in a separate place so you're not ever tempted to edit those third party libraries to override the stylesheets or something like that. And that's basically it, make sure to put your third party libraries in the vendor/assets/ folder and keep it as simple as that. If it doesn't have a gem, I would highly recommend you making one and I think I'll talk about that in the next episode because that makes perfect sense as a follow up.
If you have any of those things that you need to do, you can first dump them into the vendor folder and then just making a gem out of it makes it easier for everybody to install and to upgrade and all of that so you'll always know in your Gemfile which version of the library you're using . We'll talk about that in the next episode.
@chris. What do you think about Bower to manage all the front-end stuff?
Bower is pretty great and I plan on doing an episode on integration with that in the future. This episode was designed mostly for explaining if you're using something obscure that has no gems or packages at all for it (including Bower packages).
That would be nice to see!
Chris - how did you add the JS to the delete button in your code?
I'm trying to use sweet-alert-confirm gem to show the new alerts on standard delete links but I can't get the alert to show.
Looks like you don't use the sweet-alert-confirm gem but you're getting the results I want. Can you show the code?
If you want to use an external JS file you can just include the script tag that points to it in your layout.
The reason why you would want these inside your Rails app is that they can be included and minified inside your code reducing the number of files the browser has to download. It's faster and more efficient for your users which makes it a good idea.