title: Passbook IOS6 sends HTTP DELETE to Rails 3.0.3 server, No route matches
body: <p>I get "No route matches" when Passbook, on iOS6, sends my server an HTTP DELETE route.</p>
  
  <p>In config/routes.rb, the route looks like:</p>
  
  <pre><code>delete       "/v1/devices/:device_id/registrations/:pass_type_id/:serial_number" =&gt; "registrations#destroy"
  </code></pre>
  
  <p>and when I run "rake routes" I can see the route is there:</p>
  
  <pre><code> DELETE /v1/devices/:device_id/registrations/:pass_type_id/:serial_number(.:format) {:controller=&gt;"registrations", :action=&gt;"destroy"}
  </code></pre>
  
  <p>but when the route comes in to the Rails 3.0.3 development server as</p>
  
  <pre><code>Started DELETE "/v1/devices/515a5c955dcdd66f558e1b4041392bf3/registrations/pass.com.myserver.FreeDrink/11" for 192.168.0.22 at 2012-12-23 15:03:25 -0500
  </code></pre>
  
  <p>the rails server says:</p>
  
  <pre><code> ActionController::RoutingError (No route matches "/v1/devices/515a5c955dcdd66f558e1b4041392bf3/registrations/pass.com.myserver.FreeDrink/11"):
  actionpack (3.0.3) lib/action_dispatch/middleware/show_exceptions.rb:53:in `call'
  railties (3.0.3) lib/rails/rack/logger.rb:13:in `call'
  rack (1.2.4) lib/rack/runtime.rb:17:in `call'
  activesupport (3.0.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.2.4) lib/rack/lock.rb:11:in `block in call'
  &lt;internal:prelude&gt;:10:in `synchronize'
  rack (1.2.4) lib/rack/lock.rb:11:in `call'
  actionpack (3.0.3) lib/action_dispatch/middleware/static.rb:30:in `call'
  railties (3.0.3) lib/rails/application.rb:168:in `call'
  railties (3.0.3) lib/rails/application.rb:77:in `method_missing'
  railties (3.0.3) lib/rails/rack/log_tailer.rb:14:in `call'
  rack (1.2.4) lib/rack/content_length.rb:13:in `call'
  rack (1.2.4) lib/rack/handler/webrick.rb:52:in `service'
  /home/user/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
  /home/user/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
  /home/user/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
  </code></pre>
  
  <p>All the other routes, using HTTP GET and POST work fine.  This is the only route I'm having trouble with.  I know that some browsers don't send HTTP DELETE, only HTTP GET and HTTP POST, and rails puts something in the header to indicate that the request is a delete, but it is Passbook that is sending the HTTP DELETE request, so I don't know if that has anything to do with the problem.</p>
  
  <p>I've also tried other flavors of the route in config/routes.rb such as:</p>
  
  <p>match       "/v1/devices/:device_id/registrations/:pass_type_id/:serial_number" => "registrations#destroy", :via => :delete</p>
  
  <p>and I've also tried using other controllers.</p>
  
  <p>Any one know why Rails says that "No route matches" when the request is an HTTP DELETE?</p>