title: How to resolve a route not found in Rails 4
body: <p>I'm not sure what I'm doing wrong: On my sessions controller I have the following:</p>
  
  <pre><code>def destroy
    sign_out
    redirect_to root_url
  end
  </code></pre>
  
  <p>On my routes I have the following:</p>
  
  <pre><code>match '/signout', to: 'sessions#destroy', via: 'delete'
  </code></pre>
  
  <p>And on the link to sign out:</p>
  
  <pre><code>&lt;%= link_to content_tag(:span, 'Sign out'), signout_path, method: 'delete' %&gt;
  </code></pre>
  
  <p>Yet I'm getting a no route matches for <code>signout_path</code> error[GET]. If I understood it correctly the problem is that there is no route defined for <code>GET</code>, which is correct.</p>
  
  <p>What I can't understand is why the <code>GET</code> is method is being used instead of delete as per the link.</p>
  
  <p>Any ideas?</p>
  
  <p>EDIT: my whole routes file:</p>
  
  <p>EDIT2: The contents of my sessions controller:</p>
  
  <pre><code>class SessionsController &lt; ApplicationController
  
  def new
  end
  
  def create
  ...
  end
  
  def destroy
      sign_out
      redirect_to root_url
  end
  
  end
  </code></pre>
  
  <p>The routes:</p>
  
  <pre><code>Rails.application.routes.draw do
  
  resources :users
  resources :sessions, only: [:new, :create, :destroy]
  resources :categories
  resources :admin
  
  get 'users/new'
  root 'static_pages#home'
  match '/signup',            to: 'users#new',                        via: 'get'
  match '/signin',            to: 'sessions#new',                     via: 'get'
  match '/signout',           to: 'sessions#destroy',                 via: 'delete',          as: 'signout'
  match '/help',              to: 'static_pages#help',                via: 'get'
  match '/contact',           to: 'static_pages#contact',             via: 'get'
  match '/admin',             to: 'admin#index',                      via: 'get'
  
  end
  </code></pre>