I know you can add jQuery and bootstrap with gems, assets, and the application.css and application.js file. However, I would like to be able to add these files through a CDN.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
I have added the above into my application.html.erb file, but I seem to not be able to use bootstrap or jQuery still. Can you please explain why rails doesn't allow linking in the html file? Why must we use gems?
You need to add the js file before the closing body tag as well:
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With