title: Why is link not working? undefined local variable path or method ROR
body: <p>I cannot get my link to work:
  Users can post job listings. Other users can view the job listing and click on apply.
  Now a form should appear for the user to fill out some information. However I cannot get the path and route file right. 
  This is the link in show.html.erb that's now working</p>
  
  <pre><code>&lt;li&gt;&lt;%= link_to "Apply Now", listing_apply_path(id: listings.id) %&gt;&lt;/li&gt;
  </code></pre>
  
  <p>The form is under views/listings/apply.html.erb</p>
  
  <p>listings/show.html.erb</p>
  
  <pre><code>&lt;div class="show_listing"&gt;
  
      &lt;div class="col-md-6"&gt;
      &lt;div class="col-md-6"&gt;
          &lt;h3&gt;&lt;%= @listing.title %&gt;&lt;/h3&gt;
          &lt;h3&gt;&lt;%= @listing.location %&gt;&lt;/h3&gt;
          &lt;p&gt;&lt;%= @listing.description %&gt;&lt;/p&gt;&lt;br&gt;
          &lt;div class="center"&gt;
          &lt;li&gt;&lt;%= link_to "Apply Now", listing_apply_path(id: listings.id) %&gt;&lt;/li&gt;
      &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="show_link_position"&gt;
  &lt;% if current_user == @listing.user %&gt;
  &lt;%= link_to 'Edit', edit_listing_path, class: "btn btn-link" %&gt; |
  &lt;% end %&gt;
  &lt;%= link_to 'Back', current_user, class: "btn btn-link" %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>listings_controller.rb</p>
  
  <pre><code>    def apply
          @listing = Listing.find(params[:id])
        end
  </code></pre>
  
  <p>and routes</p>
  
  <pre><code>Rails.application.routes.draw do
  
    resources :categories
  
    get 'notifications/index'
  
    get 'notifications/create'
  
      resources :users
      resources :sessions, only: [:new, :create, :destroy]
      resources :listings
  
  
  
    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'
        match '/help',      to: 'static_pages#help',    via: 'get'
        match '/contact',   to: 'static_pages#contact',  via: 'get'
        match '/about',     to: 'static_pages#about',   via: 'get' 
        match '/new',     to: 'listings#new',   via: 'get' 
        match '/users/:name/:id', to: 'listings#show', via: :get, as: :user_listing
        match '/findjobs',     to: 'listings#index',   via: 'get' 
        match '/users/:name/:id/edit', to: 'listings#edit', via: 'get'
        match '/:id/apply', to:  'listings#apply', via: 'get'
  </code></pre>
  
  <p>I appreciate your help!</p>