I understand why a Rails index method would use the plural form of a resource – we’re showing all projects, for example.
And I understand why the show method would use the singular form – we only want to see one project, with a particular ID.
But I don’t understand why new and create would use the plural. Is there a way to create more than one project at a time? Is there some other reasoning for using the plural here that someone could explain?
New and Create aren’t plural, in the way I think about REST. Instead, I think about it like:
whatever.comis your base domain, andwhatever.com/booksmeans that you have a collection of resources each named book. The collection itself is named books.So, when you want to create a new book, you are asking the collection for the information needed to create a new book. This becomes
/books/newWhen you actually create the book, you are posting information to
/books. The HTTP verb is POST, so when you POST to your collection, you execute the create action.This looks like a good starting point on REST.