>Hi all,
>
>With a little help from DHH, I've put together what I hope is the 
>definitive guide to RESTful URL conventions for Ruby on Rails (2.0):
>
>http://microformats.org/wiki/rest/urls
>
>I would appreciate y'all talking a look at it, as the goal is to 
>evangelize these conventions to the larger community, to encourage 
>interoperability.  In particular, let me know if you have links to 
>other relevant resources and/or efforts.

Ernie,

Is there a restful convention for creating or changing association attributes 
that relates resources to each other?

For example I have a series of Activities each of which can cover many Subjects 
and Subjects can have many Activities. I can find scoped collections using 
nested resources. If:

  /subjects/5     => biology

Then

  /subjects/5/activities

Will return all the activities that cover the subject biology.

Now I'd like to add the subject biology to activity 18 but I don't need to 
update any other part of the activity resource.  It might be clear in a RESTful 
way to do this:

  /subjects/5/activities/18/belongs_to

A more natural language url form might look like this:

  /activities/18/belongs_to/subjects/5

Of course since Activities can have many Subjects and Subjects can have many 
Activities then there is either a join table to connect the two models or a 
richer has_many :through table. A plain join table has no resource 
manifestation other than the relationship between the two resources -- the 
records in the join table have no ids that refer to them specifically.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to