Monthly Archives: February 2010

Containers in the path

Coinciding with the submission of a paper for the ws://rest.2010, several controller methods have been refactorized.

We have made an intensive analysis of use cases of containers in the path, in cases like:


/spaces/global/events/meeting/agenda

/groups/3/tasks/4/turns

The following methods are now supported:

path_containers will return an array of all the containers in the path. In the last examples, well get [ spaces-global, events-meeting ] and [ groups-3, tasks-4 ]
current_container will search for a container both in path containers, as well as in the containers of current resource. Consider this example:


/spaces/global/events/meeting/agenda/agenda_entries/2
/events/meetings/agenda_entries/2
/agenda_entries/2

current_container(:type => :space) #=> returns space-global in all the former cases
Advertisements