# Restful rails

**URL:** <https://www.ruby-forum.com/t/restful-rails/167023>\
**Category:** Rails\
**Created:** [May 2, 2009, 12:35pm UTC](https://www.ruby-forum.com/t/restful-rails/167023 "2009-05-02T12:35:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaitanya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/848f3c/32.png) [@chaitanya](https://www.ruby-forum.com/u/chaitanya)\
**Post date:** [May 2, 2009, 12:35pm UTC](https://www.ruby-forum.com/t/restful-rails/167023/1 "2009-05-02T12:35:45Z")

</div>

I have some questions regarding restful rails applications.  
Is the concept of restful so tied to the database ?

What if a application does not use a database at all or if the  
application is using a legacy database which you cannot modify or does  
not have the concept of ids. How will restful urls and crud come into  
this picture.

---

<div class="post-metadata">

**Author:** ![chaitanya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/848f3c/32.png) [@chaitanya](https://www.ruby-forum.com/u/chaitanya)\
**Post date:** [May 2, 2009, 5:02pm UTC](https://www.ruby-forum.com/t/restful-rails/167023/2 "2009-05-02T17:02:40Z")

</div>

On May 1, 5:03 pm, chaitanya [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have some questions regarding restful rails applications.  
> Is the concept of restful so tied to the database ?
> 
> What if a application does not use a database at all or if the  
> application is using a legacy database which you cannot modify or does  
> not have the concept of ids. How will restful urls and crud come into  
> this picture.

REST has nothing to do with the database, it’s just a convention  
oriented around HTTP verbs and default actions associated with them.  
That is, it’s between a browser (or other client) and the controllers.

> **[Representational state transfer](https://en.wikipedia.org/wiki/Representational_State_Transfer)**
>
> Representational state transfer (REST) is a software architectural style that was created to guide the design and development of the architecture for the World Wide Web. REST defines a set of constraints for how the architecture of an Internet-scale distributed hypermedia system, such as the Web, should behave. The REST architectural style emphasises the scalability of interactions between components, uniform interfaces, independent deployment of components, and the creation of a layered architec...

---

<div class="post-metadata">

**Author:** ![chaitanya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/848f3c/32.png) [@chaitanya](https://www.ruby-forum.com/u/chaitanya)\
**Post date:** [May 3, 2009, 12:14pm UTC](https://www.ruby-forum.com/t/restful-rails/167023/3 "2009-05-03T12:14:29Z")

</div>

Hey,

It’s more about resources than the database. They’re not one to one,  
but the way most rails models are designed usually, they’re very close  
to a resource. For instance, you may have a product resource, which  
might have an attribute called name. The data for that might not  
actually be inside the products table, or perhaps your product  
resource might aggregate several associations of the product model.  
Either way there’s no implicit direct coupling of models with  
resources, but more often they tend to be close. Hope that helps.

Blog: [http://random8.zenunit.com/](http://random8.zenunit.com/)  
Learn rails: [http://sensei.zenunit.com/](http://sensei.zenunit.com/)

On 02/05/2009, at 10:03 AM, chaitanya
