title: No route matches [GET] "/signout"
body: <p>I saw a few postings related to this topic, but the given solutions did not really clarify things for me ...</p>
  
  <p>So, I am working on a rails (version 3.2.2) application that followed the setup from Michael Hartl's Ruby on Rails tutorial. The application has a signout link, which worked well until recently, when it started giving me the error 'No route matches [GET] "/signout"'.</p>
  
  <p>These are the relevant pieces:</p>
  
  <p><strong>routes.rb</strong></p>
  
  <pre><code>match '/signout' =&gt; 'sessions#destroy', :via =&gt; :delete
  </code></pre>
  
  <p><strong>sessions_controller.rb</strong></p>
  
  <pre><code>def destroy
    sign_out
    redirect_to root_path
  end
  </code></pre>
  
  <p><strong>sessions_helper.rb</strong></p>
  
  <pre><code>def sign_out
    current_user = nil
    cookies.delete(:remember_token)
  end
  </code></pre>
  
  <p><strong>_header.html.erb</strong></p>
  
  <pre><code>&lt;li&gt;
    &lt;%= link_to "Sign out", signout_path, :method =&gt; :delete %&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>All it takes for the signout to start working again is the removal of ":via => :delete" from the routes file. Is this the right approach or is there a better one? Also, why did the link stop working without any rails update?</p>
  
  <p>Thank you,
  Alexandra</p>
  
  <p>On request, I added the full code for the _header.html.erb:</p>
  
  <p><strong>full _header.html.erb</strong></p>
  
  <pre><code>&lt;!-- ***** Initialized: Listing 5.24 ***** --&gt;
  &lt;!-- ***** Updated: Listing 8.24 ***** --&gt;
  &lt;!-- ***** Updated: Listing 9.7 ***** --&gt;
  &lt;!-- ***** Begin: Listing 9.28 ***** --&gt;
  &lt;header&gt;
  &lt;header class="navbar navbar-fixed-top"&gt;
    &lt;div class="navbar-inner"&gt;
      &lt;div class="container"&gt;
        &lt;% if signed_in? %&gt;
          &lt;%= link_to "project manager", about_path, id: "logo" %&gt;
        &lt;% else %&gt;
          &lt;%= link_to "project manager", root_path, id: "logo" %&gt;
        &lt;% end %&gt;
        &lt;nav&gt;
          &lt;ul class="nav pull-right"&gt;
            &lt;!--li&gt;&lt;%= link_to "Home", root_path %&gt;&lt;/li--&gt;
            &lt;% if signed_in? %&gt;
  
  &lt;% if Rails.env.development? %&gt;
              &lt;li&gt;&lt;%= link_to "Overview", overview_path %&gt;&lt;/li&gt; 
  &lt;% end %&gt;         
  &lt;% if Rails.env.development? %&gt;
              &lt;li id="fat-menu" class="dropdown"&gt;
                &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"&gt; Projects &lt;b class="caret"&gt;&lt;/b&gt;
                &lt;/a&gt;
                &lt;ul class="dropdown-menu"&gt;
                &lt;li&gt;&lt;%= link_to "Status", projects_path %&gt;&lt;/li&gt;
                &lt;li&gt;&lt;%= link_to "Dev View", dev_projects_path %&gt;&lt;/li&gt;
                &lt;/ul&gt;
              &lt;/li&gt;
  &lt;% else %&gt;
            &lt;li&gt;&lt;%= link_to "Projects", projects_path %&gt;&lt;/li&gt;
  &lt;% end %&gt;
  &lt;% if Rails.env.development? %&gt;
              &lt;li&gt;&lt;%= link_to "Teams", teams_path %&gt;&lt;/li&gt; 
  &lt;% end %&gt;
  &lt;% if Rails.env.development? %&gt;
              &lt;li id="fat-menu" class="dropdown"&gt;
                &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"&gt; Tasks &lt;b class="caret"&gt;&lt;/b&gt;
                &lt;/a&gt;
                &lt;ul class="dropdown-menu"&gt;
                &lt;li&gt;&lt;%= link_to "Status", tasks_status_path %&gt;&lt;/li&gt;
                &lt;li&gt;&lt;%= link_to "Tree", tasks_tree_path %&gt;&lt;/li&gt;
                &lt;li&gt;&lt;%= link_to "Dev View", dev_tasks_path %&gt;&lt;/li&gt;
                &lt;/ul&gt;
              &lt;/li&gt;
  &lt;% else %&gt;
              &lt;li id="fat-menu" class="dropdown"&gt;
                &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"&gt; Tasks &lt;b class="caret"&gt;&lt;/b&gt;
                &lt;/a&gt;
                &lt;ul class="dropdown-menu"&gt;
                &lt;li&gt;&lt;%= link_to "Status View", tasks_status_path %&gt;&lt;/li&gt;
                &lt;li&gt;&lt;%= link_to "Tree View", tasks_tree_path %&gt;&lt;/li&gt;
                &lt;/ul&gt;
              &lt;/li&gt;
  &lt;% end %&gt;
  
  &lt;% if Rails.env.development? %&gt;
              &lt;li id="fat-menu" class="dropdown"&gt;
                &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"&gt; Reports &lt;b class="caret"&gt;&lt;/b&gt;
                &lt;/a&gt;
                &lt;ul class="dropdown-menu"&gt;
                &lt;li&gt;&lt;%= link_to "Project Progress", analysis_path %&gt;&lt;/li&gt;
                &lt;li&gt;&lt;%= link_to "Revision History", history_path %&gt;&lt;/li&gt;
                &lt;/ul&gt;
              &lt;/li&gt;              
  &lt;% else %&gt;
              &lt;li id="fat-menu" class="dropdown"&gt;
                &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"&gt; Reports &lt;b class="caret"&gt;&lt;/b&gt;
                &lt;/a&gt;
                &lt;ul class="dropdown-menu"&gt;
                &lt;li&gt;&lt;%= link_to "Revision History", history_path %&gt;&lt;/li&gt;
                &lt;/ul&gt;
              &lt;/li&gt;
  &lt;% end %&gt;
  &lt;% if Rails.env.development? %&gt;
              &lt;li&gt;&lt;%= link_to "Help", help_path %&gt;&lt;/li&gt;
  &lt;% end %&gt;
              &lt;li id="fat-menu" class="dropdown"&gt;
                &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"&gt; Account &lt;b class="caret"&gt;&lt;/b&gt;
                &lt;/a&gt;
                &lt;ul class="dropdown-menu"&gt;
  &lt;% if current_user.admin? %&gt;
                  &lt;li&gt;&lt;%= link_to "Admin", users_path %&gt;&lt;/li&gt; 
  &lt;% end %&gt;
  &lt;% if Rails.env.development? %&gt;
                  &lt;li&gt;&lt;%= link_to "Profile", current_user %&gt;&lt;/li&gt;
  &lt;% end %&gt;
                  &lt;li&gt;&lt;%= link_to "Settings", edit_user_path(current_user) %&gt;&lt;/li&gt;
                  &lt;li class="divider"&gt;&lt;/li&gt;
                  &lt;li&gt;
                    &lt;%= link_to "Sign out", signout_path, :method =&gt; :delete %&gt;
                  &lt;/li&gt;
                &lt;/ul&gt;
              &lt;/li&gt;
            &lt;% else %&gt;
              &lt;li&gt;&lt;%= link_to "Sign in", signin_path %&gt;&lt;/li&gt;
            &lt;% end %&gt;
          &lt;/ul&gt;
        &lt;/nav&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/header&gt;
  &lt;!-- ***** End: Listing 9.28 ***** --&gt;
  </code></pre>