Rails route not found, but exists in rake routes
<p>I'm trying to create a new resource called a Snapshot, to consolidate a couple of actions that probably should be a resource of their own rather than cluttering up the ProjectsController. I'm sure I've set everything up correctly, but Rails doesn't recognise the route.</p>

<p>Here's the relevant excerpt from my routes.rb:</p>

<pre><code>resources :projects do
  resources :snapshots, only: [:create, :update]
end
</code></pre>

<p>It shows up when I run <code>rake routes</code> just fine:</p>

<pre><code>project_snapshots POST     /projects/:project_id/snapshots(.:format)                                          snapshots#create
 project_snapshot PATCH    /projects/:project_id/snapshots/:id(.:format)                                      snapshots#update
                  PUT      /projects/:project_id/snapshots/:id(.:format)                                      snapshots#update
</code></pre>

<p>But in the rails console, I don't get any joy:</p>

<pre><code>r = Rails.application.routes
=&gt; #&lt;ActionDispatch::Routing::RouteSet:0x007faa06b5b730&gt;

r.recognize_path "/projects/1234/snapshots"
ActionController::RoutingError: No route matches "/projects/1234/snapshots"
    from /Users/merus/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:840:in `recognize_path'
    from (irb):4
    from /Users/merus/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/console.rb:110:in `start'
    from /Users/merus/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/console.rb:9:in `start'
    from /Users/merus/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:68:in `console'
    from /Users/merus/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /Users/merus/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `&lt;top (required)&gt;'
    from bin/rails:4:in `require'
    from bin/rails:4:in `&lt;main&gt;'
</code></pre>

<p>I've tried replacing 'resources' with 'resource' just in case that doesn't work; no dice. What's wrong here?</p>