title: index route for a resource is POST
body: <p>I have a Game model in my Rails app. In the routes file, I created a resource route for it</p>
  
  <pre><code>resource :games,  defaults: {format: :json}
  </code></pre>
  
  <p>However, when I made an ajax request to url: 'games' using Backbone, I got a 404 error. Running <code>rake routes</code> shows that 'games' is a POST request, and is linked to the create action of the games controller, which is obviously not what it's supposed to be (see the rake routes for my Question resource below). </p>
  
  <p>I've also included my Game model code below.</p>
  
  <p>Can anyone explain what I've done wrong? </p>
  
  <p>rake routes Game.rb</p>
  
  <pre><code> games POST   /games(.:format)                 games#create {:format=&gt;:json}
   new_games GET    /games/new(.:format)         games#new {:format=&gt;:json}
   edit_games GET    /games/edit(.:format)       games#edit {:format=&gt;:json}
   GET    /games(.:format)                       games#show {:format=&gt;:json}
   PUT    /games(.:format)                       games#update {:format=&gt;:json}
   DELETE /games(.:format)                       games#destroy {:format=&gt;:json}
  </code></pre>
  
  <p>By comparison, here  are the routes for the  Question model</p>
  
  <pre><code>questions GET    /questions(.:format)                  questions#index
            POST   /questions(.:format)                  questions#create
  new_question GET    /questions/new(.:format)           questions#new
  edit_question GET    /questions/:id/edit(.:format)     questions#edit
  question GET    /questions/:id(.:format)               questions#show
           PUT    /questions/:id(.:format)               questions#update
           DELETE /questions/:id(.:format)               questions#destroy
  </code></pre>
  
  <p>Game model</p>
  
  <pre><code>class Game &lt; ActiveRecord::Base
    attr_accessible :creator_id, :name
  
    has_many :results 
    has_many :users, :through =&gt; :results
  
    has_reputation :votes, source: :user, aggregated_by: :sum #for Active_record_reputation gem
  
  
    class &lt;&lt; self    
      def win?(chars_left, incorrect_guesses)
        chars_left == 0 and incorrect_guesses &lt; 6
      end
  
  
  
      def correct_response?(correctanswer, guess)
          correctanswer == guess
      end 
  
  
      def correct_guess?(char_clicked, final_word)
  
        puts char_clicked
        puts final_word =~ /#{char_clicked}/i
        if final_word =~ /#{char_clicked}/i 
          true
        else
          false
        end 
  
      end
  
  
  
    end
  end
  </code></pre>