Thursday March 20, 2008
activeresource external url calls
Following up on yesterdays articles I thought I'd list the rails find command and corresponding url call.
in our model if we have set up self.site = "http://domain.com/rest/"
User.find(:all) -> http://domain.com/rest/users.xml
User.find(1) -> http://domain.com/rest/users/1.xml
User.find(100) -> http://domain.com/rest/users/100.xml
So if your doing an :all, the app will look for model.xml. If your doing any other call, it'll look for model/?.xml. I hope this helps when building external activeresource communicators.
Back
