title: Ruby On Rails errors with javascript_include_tag
body: <p>So my issue, from what I can tell, seems to be that ruby is not loading all of its javascript files as I am not getting confirm messages and link_to with method: :delete does nothing for me.</p>
  
  <p>With the default set up provided to me rails new </p>
  
  <p>views/layouts/application.html.erb head section is as follows.</p>
  
  <pre><code>&lt;head&gt;
    &lt;title&gt;Myrubyblog&lt;/title&gt;
    &lt;%= stylesheet_link_tag    'default', media: 'all', 'data-turbolinks-track' =&gt; true %&gt;
    &lt;%= javascript_include_tag 'default', 'data-turbolinks-track' =&gt; true%&gt;
    &lt;%= csrf_meta_tags %&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>Which gives me the error </p>
  
  <pre><code>Started GET "/posts" for 127.0.0.1 at 2015-02-27 02:14:57 -0600
    ActiveRecord::SchemaMigration Load (0.0ms)  SELECT "schema_migrations".* FROM "schema_migrations"
  Processing by PostsController#index as HTML
    Post Load (1.0ms)  SELECT "posts".* FROM "posts"
    Rendered posts/index.html.erb within layouts/application (11.0ms)
  Completed 200 OK in 76ms (Views: 54.0ms | ActiveRecord: 4.0ms)
  
  
  Started GET "/stylesheets/default.css" for 127.0.0.1 at 2015-02-27 02:14:58 -0600
  
  ActionController::RoutingError (No route matches [GET] "/stylesheets/default.css"):
    actionpack (4.1.8) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
    actionpack (4.1.8) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
    railties (4.1.8) lib/rails/rack/logger.rb:38:in `call_app'
    railties (4.1.8) lib/rails/rack/logger.rb:20:in `block in call'
    activesupport (4.1.8) lib/active_support/tagged_logging.rb:68:in `block in tagged'
    activesupport (4.1.8) lib/active_support/tagged_logging.rb:26:in `tagged'
    activesupport (4.1.8) lib/active_support/tagged_logging.rb:68:in `tagged'
    railties (4.1.8) lib/rails/rack/logger.rb:20:in `call'
    actionpack (4.1.8) lib/action_dispatch/middleware/request_id.rb:21:in `call'
    rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
    rack (1.5.2) lib/rack/runtime.rb:17:in `call'
    activesupport (4.1.8) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
    rack (1.5.2) lib/rack/lock.rb:17:in `call'
    actionpack (4.1.8) lib/action_dispatch/middleware/static.rb:84:in `call'
    rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
    railties (4.1.8) lib/rails/engine.rb:514:in `call'
    railties (4.1.8) lib/rails/application.rb:144:in `call'
    rack (1.5.2) lib/rack/lock.rb:17:in `call'
    rack (1.5.2) lib/rack/content_length.rb:14:in `call'
    rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
    c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
    c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
    c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
  
  
    Rendered c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/templates/rescues/
  _trace.html.erb (1.0ms)
    Rendered c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/templates/routes/_
  route.html.erb (1.0ms)
    Rendered c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/templates/routes/_
  table.html.erb (9.0ms)
    Rendered c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/templates/rescues/
  routing_error.html.erb within rescues/layout (46.1ms)
  
  
  Started GET "/javascripts/default.js" for 127.0.0.1 at 2015-02-27 02:14:58 -0600
  
  ActionController::RoutingError (No route matches [GET] "/javascripts/default.js"):
    actionpack (4.1.8) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
    actionpack (4.1.8) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
    railties (4.1.8) lib/rails/rack/logger.rb:38:in `call_app'
    railties (4.1.8) lib/rails/rack/logger.rb:20:in `block in call'
    activesupport (4.1.8) lib/active_support/tagged_logging.rb:68:in `block in tagged'
    activesupport (4.1.8) lib/active_support/tagged_logging.rb:26:in `tagged'
    activesupport (4.1.8) lib/active_support/tagged_logging.rb:68:in `tagged'
    railties (4.1.8) lib/rails/rack/logger.rb:20:in `call'
    actionpack (4.1.8) lib/action_dispatch/middleware/request_id.rb:21:in `call'
    rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
    rack (1.5.2) lib/rack/runtime.rb:17:in `call'
    activesupport (4.1.8) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
    rack (1.5.2) lib/rack/lock.rb:17:in `call'
    actionpack (4.1.8) lib/action_dispatch/middleware/static.rb:84:in `call'
    rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
    railties (4.1.8) lib/rails/engine.rb:514:in `call'
    railties (4.1.8) lib/rails/application.rb:144:in `call'
    rack (1.5.2) lib/rack/lock.rb:17:in `call'
    rack (1.5.2) lib/rack/content_length.rb:14:in `call'
    rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
    c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
    c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
    c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
  
  
    Rendered c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/templates/rescues/
  _trace.html.erb (1.0ms)
    Rendered c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/templates/routes/_
  route.html.erb (2.0ms)
    Rendered c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/templates/routes/_
  table.html.erb (1.0ms)
    Rendered c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/templates/rescues/
  routing_error.html.erb within rescues/layout (35.8ms)
  </code></pre>
  
  <p>This error also occurs when I change the stylescheet_link_tag and javascript_include_tag to use :default instead of 'default'.</p>
  
  <p>This error seems to be occuring because /javascripts/default.js doesn't exist, so I found these two articles which said that :default is no longer supported.</p>
  
  <p><a href="https://stackoverflow.com/questions/18154916/rails-4-link-to-destroy-not-working-in-getting-started-tutorial">Rails 4 link_to Destroy not working in Getting Started tutorial</a></p>
  
  <p><a href="https://stackoverflow.com/questions/3774925/delete-link-sends-get-instead-of-delete-in-rails-3-view">Delete link sends &quot;Get&quot; instead of &quot;Delete&quot; in Rails 3 view</a></p>
  
  <p>After changing 'default' to 'application' I got the following error.</p>
  
  <p>views/layouts/application.html.erb head section is as follows.</p>
  
  <pre><code>&lt;head&gt;
    &lt;title&gt;Myrubyblog&lt;/title&gt;
    &lt;%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' =&gt; true %&gt;
    &lt;%= javascript_include_tag 'application', 'data-turbolinks-track' =&gt; true%&gt;
    &lt;%= csrf_meta_tags %&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>Which gives me the error</p>
  
  <pre><code>Started GET "/posts" for 127.0.0.1 at 2015-02-27 02:26:28 -0600
    ActiveRecord::SchemaMigration Load (1.0ms)  SELECT "schema_migrations".* FROM "schema_migrations"
  Processing by PostsController#index as HTML
    Post Load (1.0ms)  SELECT "posts".* FROM "posts"
    Rendered posts/index.html.erb within layouts/application (12.0ms)
  Completed 500 Internal Server Error in 2198ms
  
  ActionView::Template::Error (TypeError: Object doesn't support this property or method
    (in c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/turbolinks-2.5.3/lib/assets/javascripts/turbolinks.js.coffee)):
      3: &lt;head&gt;
      4:   &lt;title&gt;Myrubyblog&lt;/title&gt;
      5:   &lt;%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' =&gt; true %&gt;
      6:   &lt;%= javascript_include_tag 'application', 'data-turbolinks-track' =&gt; true %&gt;
      7:   &lt;%= csrf_meta_tags %&gt;
      8: &lt;/head&gt;
      9: &lt;body&gt;
    app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb___474145341_51059580'
  
  
    Rendered c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/templates/rescues/
  _trace.html.erb (1.0ms)
    Rendered c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/templates/rescues/
  _request_and_response.html.erb (1.0ms)
    Rendered c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/templates/rescues/
  template_error.html.erb within rescues/layout (20.0ms)
  </code></pre>
  
  <p>Does anyone have any idea what my issue is?</p>
  
  <p>My routes and gemfile for reference if need be.</p>
  
  <p>routes.rb</p>
  
  <pre><code>Rails.application.routes.draw do
    get 'categories/index'
  
    get 'categories/edit'
  
    get 'categories/new'
  
    get 'categories/show'
  
    get 'home/index'
  
    resources :posts
    resources :categories
  
    root 'home#index'
  end
  </code></pre>
  
  <p>gemfile</p>
  
  <pre><code>source 'https://rubygems.org'
  
  
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
  gem 'rails', '4.1.8'
  # Use sqlite3 as the database for Active Record
  #gem 'sqlite3'
  gem 'pg'
  # 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'
  # 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
  
  # 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>