title: Need to reload my page to see some elements using Rails
body: <p>i'm currently working on a University project, and i have to deploy a web page using Rails. 
  Using Materialize Css for rails, the only way that, on a form, the element "Select" works is reloading the page, also for others javascripts it seems that they only works reloading the page... Now i'm using a "script" that reloads once the page but its totally a bad practicing</p>
  
  <p>here you have the Application.js </p>
  
  <pre><code>//= require jquery
  //= require jquery.turbolinks
  
  //= require jquery_ujs
  //= require materialize-sprockets
  //= require_tree .
  
  //= require turbolinks
  </code></pre>
  
  <p>the gemfile </p>
  
  <pre><code>source 'https://rubygems.org'
  
  
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
  gem 'rails', '4.1.4'
  # Use sqlite3 as the database for Active Record
  group :development, :test do
      gem 'sqlite3'
  end
  group :production do
    gem 'pg'
  end
  #gem 'pg', group: :production
  #gem 'sqlite3'
  # Use SCSS for stylesheets
  gem 'sass-rails', '~&gt; 4.0.3'
  # Use Uglifier as compressor for JavaScript assets
  gem 'uglifier', '&gt;= 1.3.0'
  # Use CoffeeScript for .js.coffee assets and views
  gem 'coffee-rails', '~&gt; 4.0.0'
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer',  platforms: :ruby
  
  # Use jquery as the JavaScript library
  gem 'jquery-rails'
  # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
  gem 'turbolinks'
  gem 'jquery-turbolinks'
  
  # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
  gem 'jbuilder', '~&gt; 2.0'
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', '~&gt; 0.4.0',          group: :doc
  gem 'hirb'
  gem 'carrierwave'
  #gem 'bootstrap-sass', '~&gt; 3.3.0'
  gem 'devise'
  gem 'rolify'
  gem 'cancan'
  gem 'will_paginate'
  gem 'will_paginate-bootstrap'
  #gem "twitter-bootstrap-rails"
  gem 'therubyracer', :platform =&gt; :ruby
  gem 'materialize-sass'
  gem 'rails_12factor', group: :production  
  gem 'puma'
  gem 'cloudinary'
  
  #gem 'libv8', '3.11.8.0'
  # Use ActiveModel has_secure_password
  # gem 'bcrypt', '~&gt; 3.1.7'
  
  # Use unicorn as the app server
  # gem 'unicorn'
  
  # Use Capistrano for deployment
  # gem 'capistrano-rails', group: :development
  
  # Use debugger
  # gem 'debugger', group: [:development, :test]
  
  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
  gem 'tzinfo-data', platforms: [:mingw, :mswin]
  </code></pre>
  
  <p>applications.scss</p>
  
  <pre><code>@import "materialize";
  </code></pre>
  
  <p>and finally the _form</p>
  
  <pre><code> &lt;script&gt;
    $(document).ready(function() {
      $('select').material_select();
    });&lt;/script&gt;
  &lt;div class="container"&gt;
  &lt;%= form_for @articulo, :html =&gt;{:multipart =&gt; true} do |f| %&gt;
        &lt;div class="row"&gt;
          &lt;div class="input-field col s6"&gt;
            &lt;%= f.text_field :nombre%&gt;
            &lt;label for="first_name"&gt;Nombre del producto&lt;/label&gt;
          &lt;/div&gt;
          &lt;div class="input-field col s6"&gt;
            &lt;%= f.text_field :ubicacion%&gt;
            &lt;label for="ubicacion"&gt;Ubicación&lt;/label&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="row"&gt;
           &lt;div class="input-field col s6"&gt;
            &lt;label for="precio"&gt;Precio $&lt;/label&gt;
            &lt;%=f.text_field :precio, :class =&gt; 'text_field', :min =&gt; 0, :step =&gt; 0.01, required: true%&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="file-field input-field"&gt;
        &lt;div class="btn"&gt;
          &lt;span&gt;Imagen&lt;/span&gt;&lt;input type="file"&gt;
  
         &lt;%= f.file_field :foto %&gt;
        &lt;/div&gt;
         &lt;div class="file-path-wrapper"&gt;
          &lt;input class="file-path validate" type="text"&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="row"&gt;
          &lt;div class="input-field col s12"&gt;
          &lt;%= f.text_field :descripcion, :class=&gt; "materialize-textarea"%&gt;
            &lt;label for="textarea1"&gt;Descripción&lt;/label&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="row"&gt;
        &lt;div class="col s6" id="category_id"&gt; 
          &lt;%= f.label :category_id, 'Categoría' %&gt;
            &lt;%= collection_select(:article, :category_id, Category.where(eliminado: false).all , :id, :nombre,class: "browser-default") %&gt;
            &lt;/div&gt;
        &lt;/div&gt;  
        &lt;br&gt;
            &lt;%= f.submit "Publicar", class: 'btn ' %&gt;&lt;%end%&gt;
  
    &lt;/div&gt;
  </code></pre>
  
  <p>------- Edit------
  i 've solved this problem; locally it works but when i upload it into Heroku, happens the same... any solution? or how could i update gemfile in heroku?</p>