One-to-One Associations and REST

I've read the B-Simple REST tutorial (http://www.b-simple.de/documents)
which explains this process for one-to-many associations. But things are
a little different for me, because I only want one avatar per user, I do
not need an index action and the urls do look different. For example, I
want /user/:user_id/avatar to show the user avatar,
/user/:user_id/avatar;edit to change the avatar etc.

map.resources :people do |people|
  people.resource :avatar
end

avatar_url(:person_id => person) # => /people/5/avatar
edit_avatar_url(:person_id => person) # => /people/5/avatar;edit

on a similar note, what's generally regarded as best practice for a
REST-ful multi-lingual site, let's say one which uses Globalize,
where the language code has to be passed around in the URL (so that
pages can be cached easily per language)?

If the first part of the URL always holds the language code, e.g.:

  http://mysite.tld/en/
  http://mysite.tld/de/
  http://mysite.tld/es/

How is this declared using resource/resources? An outer map.resource
which contains all other route mappings?

3 mar 2007 kl. 17.45 skrev DHH: