View Single Post
Old 06-01-2012, 09:25 AM   PM User | #2
kaizenfury7
New to the CF scene

 
Join Date: May 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
kaizenfury7 is an unknown quantity at this point
When it comes to Ruby on Rails, RESTful is a way for writing web services.

For instance, let's say you want to build an RESTful api to manage cars:

http://host/cars - when you do a GET on this URL, you should get a list of cars
http://host/cars/1 - when you do a GET on this URL, you are tring to get a car that has the ID of 1
http://host/cars/1 - when you do a PUT on this URL, it means you are trying to update the car with the ID of 1
http://host/cars/1 - when you do a DELETE on this URL, it means you are trying to delete the car with the ID of 1

This isn't the only way of doing this, you can custom design your API and name things however you want or use whatever method (GET/PUT/POST/DELETE) you want to try to do those 4 actions (list, read, update, delete). However, the REST way follows some principles that allows you and third parties to interact more easily with your API because of the assumptions it makes.

Here's there definition from the Ruby on Rails docs:
http://guides.rubyonrails.org/getting_started.html#rest

Last edited by kaizenfury7; 06-01-2012 at 09:37 AM..
kaizenfury7 is offline   Reply With Quote