I have installed all necessary gems to have jQuery, Sass and Bootstrap Sass in my rails project. However, I do not know how to start making use of them. I have also included all Bootstrap files in the assets pipeline and modified the files to import/require those files.
This is my application.css.scss:
@import "_bootstrap-sprockets";
@import "_bootstrap";
And this is my application.js:
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
//= require bootstrap-sprockets
Now I have generated a controller and tried to use jQuery in it, straight without doing anything special, like this:
<script type="text/javascript">$(function() { alert('Hello') })</script>
But apparently, I am doing something wrong. Do I need to do some sort of inclusion of jQuery/Bootstrap/Stylesheets in my erb files?
As said, I'm a novice in Rails and I'm looking to get started. Answers would be highly appreciated.