Materialize css select not working with JS errors
<p>I have an issue with select form using Materialize css framework. This is my form:  </p>

<pre><code>&lt;div class="input-field col s12"&gt;
    &lt;select multiple&gt;
        &lt;option value="" disabled selected&gt;Choose your option&lt;/option&gt;
        &lt;option value="1"&gt;Option 1&lt;/option&gt;
        &lt;option value="2"&gt;Option 2&lt;/option&gt;
        &lt;option value="3"&gt;Option 3&lt;/option&gt;
    &lt;/select&gt;
    &lt;label&gt;Materialize Multiple Select&lt;/label&gt;
&lt;/div&gt;

&lt;script src="//code.jquery.com/jquery-2.1.2.min.js"&gt;&lt;/script&gt;
&lt;script src="//cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/js/materialize.min.js"&gt;&lt;/script&gt;

&lt;script&gt;
    $('select').material_select();
&lt;/script&gt;
</code></pre>

<p>This is my layout in slim:</p>

<pre><code>doctype html
html
  head
    meta content=("text/html; charset=UTF-8") http-equiv="Content-Type" /
    title Budeprace
    = stylesheet_link_tag    'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/css/materialize.min.css', media: 'screen,projection'
    = stylesheet_link_tag    'http://fonts.googleapis.com/icon?family=Material+Icons'
    = stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' =&gt; true
    = javascript_include_tag 'application', 'data-turbolinks-track' =&gt; true
    = csrf_meta_tags
    meta content="width=device-width, initial-scale=1.0" name="viewport"

  body
    .container
      - flash.each do |key, value|
        div class=("text-center #{flash_class(key)}") 
          = value

      = yield

      = javascript_include_tag 'http://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/js/materialize.min.js'
      = javascript_include_tag 'http://code.jquery.com/jquery-2.1.2.min.js'
</code></pre>

<p>If I remove the two .js scripts from layout, the SELECT works. If I will remove the two scripts from the form and leave them in layout, the SELECT won't work anymore with following error in browser: </p>

<pre><code>"job:65 Uncaught TypeError: $(...).material_select is not a function"
</code></pre>

<p>The error remain even if I will put it to the application.js in this way:</p>

<pre><code>  $(document).ready(function() {
    $('select').material_select();
  });
</code></pre>

<p>Any idea what is wrong? I went along many select and dropdown problems with materialize but couldn't figure it out.</p>

<p>Thank you.</p>