On Thu, Jul 22, 2010 at 19:04, Éric Malenfant <eric.malenf...@gmail.com> wrote:

> A probably noob-ish question about the restful urls, but I searched
> the groups archives and could not find it.
>
> IIUC, "GET /users/bob" should return a page showing information about
> the user identified with "bob", while "GET /users/new" returns a page
> with a form for creating a new user.
>
> Ain't there an ambiguity there? Does that mean that I have to make
> sure that no user chooses "new" as his id?

If you retrieve them by name, yes, but usually what I've seen,
especially with Rails, is retrieval by ID number.  So, you'd have GET
/users/23 or whatever, who may happen to be named Bob.  Or if you want
to get them by name, GET /users/search?name=bob, or maybe even
/users/show?name=bob, or if the name isn't unique, possibly
/users/index?name=bob.

-Dave

-- 
Specialization is for insects. | Professional: http://davearonson.com
-Robert Anson Heinlein         | Programming:  http://codosaur.us
-------------------------------+ Leadership:   http://dare2xl.com
Have Pun, Will Babble!  -me    | Et Cetera:    http://davearonson.net

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to