This project is archived and is in readonly mode.

#760 ✓ wontfix
Niranjan Paranjape

ActiveResource with map.resource

Reported by Niranjan Paranjape | August 5th, 2008 @ 08:44 AM | in 2.x

I am using ActiveResource to access RESTful api. One of the resource exposed by API is a singleton resource (In routes it is mapped using maps.resource instead of maps.resources).

Say 'Booga' is the singleton resource exposed by REST following is the list of problems I am facing right now

1. REST has to expose pluralize API (boogas) for singleton resource because ActiveResource would generate all requests for collection name.

2. Invoking find(:first) on ActiveResource results in error as it expects an array in response where as REST returns a single entity. (show/get doesn't work)

3. Booga.new(:id => 1, :name => ......).save would invoke a PUT request on URL .../boogas/1, where as the PUT URL exposed by REST is .../boogas; hence it results in error 'No matching routes found' (update/put doesn't work)

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Tickets have moved to Github

The new ticket tracker is available at https://github.com/rails/rails/issues

Shared Ticket Bins

People watching this ticket

Pages