title: Rails Guides: Getting Started 5.13 Deleting Articles: Confirmation Dialog Box WON'T Appear
body: <p>I am currently trying to get Rails to run on my Windows 7 machine and I am having difficulty.  I am very new to Rails (inferred by my use of the Getting Started guide) and I am stuck on this:</p>
  
  <p><a href="http://guides.rubyonrails.org/getting_started.html#deleting-articles" rel="nofollow noreferrer">http://guides.rubyonrails.org/getting_started.html#deleting-articles</a></p>
  
  <p>Specifically the, you guessed it, confirmation dialog box.  It never appears and Rails just utilizes a SHOW route.</p>
  
  <p>Now for the code:</p>
  
  <p>app\assets\javascripts\application.js</p>
  
  <pre><code>// This is a manifest file that'll be compiled into application.js, which will include all the files
  // listed below.
  //
  // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
  // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
  //
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
  // compiled file.
  //
  // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
  // about supported directives.
  //
  //= require jquery
  //= require jquery_ujs
  //= require turbolinks
  //= require jquery.ui.all
  //= require_tree .
  </code></pre>
  
  <p>app\controllers\articles_controller.rb</p>
  
  <pre><code>class ArticlesController &lt; ApplicationController
    def index
      @articles = Article.all
    end
  
    def show
      @article = Article.find(params[:id])
    end
  
    def new
      @article = Article.new
    end
  
    def edit
      @article = Article.find(params[:id])
    end
  
    def create
      @article = Article.new(article_params)
  
      if @article.save
        redirect_to @article
      else
        render 'new'
      end
    end
  
    def update
      @article = Article.find(params[:id])
  
      if @article.update(article_params)
        redirect_to @article
      else
        render 'edit'
      end
    end
  
    def destroy
      @article = Article.find(params[:id])
      @article.destroy
  
      redirect_to articles_path
    end
  
    private
      def article_params
        params.require(:article).permit(:title, :text)
      end
  end
  </code></pre>
  
  <p>app\views\articles\index.html.erb</p>
  
  <pre><code>&lt;h1&gt;Listing Articles&lt;/h1&gt;
  &lt;%= link_to 'New article', new_article_path %&gt;
  
  &lt;table&gt;
    &lt;tr&gt;
      &lt;th&gt;Title&lt;/th&gt;
      &lt;th&gt;Text&lt;/th&gt;
      &lt;th colspan="3"&gt;&lt;/th&gt;
    &lt;/tr&gt;
  
    &lt;% @articles.each do |article| %&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;%= article.title %&gt;&lt;/td&gt;
        &lt;td&gt;&lt;%= article.text %&gt;&lt;/td&gt;
        &lt;td&gt;&lt;%= link_to 'Show', article %&gt;&lt;/td&gt;
        &lt;td&gt;&lt;%= link_to 'Edit', edit_article_path(article) %&gt;&lt;/td&gt;
        &lt;td&gt;&lt;%= link_to 'Destroy', article_path(article),
                method: :delete,
                data: { confirm: 'Are you sure?' } %&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;% end %&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>and app\views\layouts\application.html.erb</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Blog&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;
  &lt;body&gt;
  
  &lt;%= yield %&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  
  &lt;!--%= javascript_include_tag 'application', 'data-turbolinks-track' =&gt; true %--&gt;
  </code></pre>
  
  <p>Now in the command line, when I click the, "link_to," Destroy link, I get:</p>
  
  <pre><code>[2015-09-15 18:48:26] ERROR Errno::ECONNRESET: An existing connection was forcibly closed by the remote host. @ io_fillbuf - fd:10
      C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:80:in 'eof?'
      C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:80:in 'run'
      C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/server.rb:295:in 'block in start_thread'
    Rendered C:/...
  </code></pre>
  
  <p>Note that everything seems normal after:</p>
  
  <pre><code>Rendered C:/
  </code></pre>
  
  <p>To fix this issue on my own, I have:</p>
  
  <ul>
  <li>Made sure SQLite is on my machine</li>
  <li>The SQLite gem is installed</li>
  <li>Active scripts are turned on for my web browser (Opera; based on
  Chromium)</li>
  </ul>
  
  <p>I have followed every piece of advice I could from Stack Exchange and Stack Overflow, including:</p>
  
  <p>Modifying index.html.erb with:</p>
  
  <pre><code>&lt;%= link_to 'Destroy',  post,  method: :delete, data: { confirm: 'Are you sure?' } %&gt;
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>link_to 'Cancel?', schedule_path(current_user.schedules[0]), :confirm =&gt; "are you sure?", :method =&gt; :delete
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>&lt;td&gt;&lt;%= link_to 'Destroy', { action: :destroy, id: post.id }, method: :delete, data: { confirm: 'Are you sure?' } %&gt;&lt;/td&gt;
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>&lt;td&gt;&lt;%= link_to 'Destroy', [comment.post, comment], method: :delete, data: { confirm: 'Are you sure?' } %&gt;&lt;/td&gt;
  </code></pre>
  
  <ul>
  <li>Making sure that because I am on Windows 7, that my CoffeeScript is
  version 1.8.0 and that I updated the Gemfile as such</li>
  <li>Making sure the gem, "jquery-rails," is included in the Gemfile file</li>
  <li>Using method: destroy instead of method: delete</li>
  <li>My rake routes look as they should.  One answer mentioned making sure
  <code>bin/rake routes</code> returned something normal and it does</li>
  </ul>
  
  <p>Making sure the application.js file includes:</p>
  
  <pre><code>//= require jquery
  //= require jquery_ujs
  </code></pre>
  
  <p>(which you can see above that it does)</p>
  
  <p>and nothing, <strong>NOTHING</strong>, has worked.</p>
  
  <p>The only thing I have tried that has given me <strong>ANY</strong> success is replacing the <code>link_to</code> in index.html.erb with <code>button_to</code>.</p>
  
  <p>But this doesn't produce a confirmation window.  It just performs a DESTROY.</p>
  
  <p>I am very confused and I have spent many hours trying to get this to work.</p>
  
  <p>I have found my answers from these links:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/8065717/rails-crud-destroy-path-always-routes-to-the-user-show-page">Rails CRUD - Destroy path always routes to the User show page</a></li>
  <li><a href="https://stackoverflow.com/questions/28241981/rails-4-execjsprogramerror-in-pageswelcome">Rails-4, ExecJS::ProgramError in Pages#welcome</a></li>
  <li><a href="https://stackoverflow.com/questions/30850226/rails-default-js-is-empty-and-jquery-and-jquery-ujs-not-loaded">Rails, default.js is empty, and jquery and jquery_ujs not loaded</a></li>
  <li><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></li>
  </ul>
  
  <p>I may be missing a few links and answers, so please feel free to link me to a thread you think I may have missed.</p>
  
  <p>Thank you for reading this <strong>MASSIVE</strong> wall of text and I hope I can find a solution to my problem soon.</p>