views:

228

answers:

4

I have an extremely simple routes.rb in my Rails app:

ActionController::Routing::Routes.draw do |map|
  map.resources :tags
end

Starting up my app with script/server and pointing my browser to localhost:3000/tags/ yields:

ActionController::MethodNotAllowed

Only get and post requests are allowed.

...

Starting up my app with script/server webrick, however, solves the problem.

Later: in case it matters, I'm running Mongrel 1.1.5 on OSX 10.5.5.

A: 

I have seen this happen with older versions of mongrel, but 1.1.5 is not old. I have also seen some similar problems when the browser double-posts a request to a URL. Is that happening here?

I'd need some more information to be able to help you: What browser are you using? Are you using the firebug plugin on Firefox? What does the server log say about the request, other than the MethodNotAllowed exception?

Pete
A: 

Somethings to check:

  • sometimes you need to restart your server to load new routes.
  • TagsController exists?
  • index action in TagsController exists?

I'm curious to see the stack trace here.

danpickett
A: 

Did you check your codes for example related with form_for, to check if has any typo? When you run rake routes, everything is fine? I saw this problem before and it was related with a typo in the form_for parameters.

Did you update your mongrel? gem update mongrel?

Did you check your project log? log*.log?

Regards,

Victor

VP
+1  A: 
  1. Check your generated routes for problems with "rake routes | grep tag"
  2. Check the actual method that is being called, and the verb it is being called with by tail -f log/development.log

This should bring up any obvious problems.

Mr. Matt