Singular Resources May 18th, 2007

This just bit me in the butt and I had trouble figuring out why.

If you want to use singular resources in rails (ie session) then you need to specify them as:

map.resource :session
NOTE: the resource is singular.

If you don't you'll get an error akin to:
session_url failed to generate from {:controller=>"session", :action=>"show"} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: ["session", :id] - are they all satisfied?

It was driving me nuts. Easy to overlook and hard to find info from the googles.

tags: REST