# So what is REST? I don't get how it fits in Rails

**URL:** <https://www.ruby-forum.com/t/so-what-is-rest-i-dont-get-how-it-fits-in-rails/98076>\
**Category:** Rails\
**Created:** [July 12, 2006, 1:41pm UTC](https://www.ruby-forum.com/t/so-what-is-rest-i-dont-get-how-it-fits-in-rails/98076 "2006-07-12T13:41:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pergesu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Post date:** [July 12, 2006, 1:41pm UTC](https://www.ruby-forum.com/t/so-what-is-rest-i-dont-get-how-it-fits-in-rails/98076/1 "2006-07-12T13:41:42Z")

</div>

Does someone have an actual example of this? I saw DHH’s slides where  
he said that you could have your app automatically respond with HTML,  
XML, atom, whatever. So far I’ve found tons of discussion on REST and  
CRUD in Rails, but I haven’t seen anything that actually shows me what  
it all is. There’s simply\_restful, which apparently makes things  
easier…I don’t know what though. I’ve done a lot of reading, so I  
know what REST is, I just don’t know how people use it in Rails. If  
anyone has some examples and explanations, I’d really appreciate it.

Pat

---

<div class="post-metadata">

**Author:** ![pergesu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Post date:** [July 12, 2006, 2:46pm UTC](https://www.ruby-forum.com/t/so-what-is-rest-i-dont-get-how-it-fits-in-rails/98076/2 "2006-07-12T14:46:24Z")

</div>

Hi Pat,

I’m not going to be much help for you, but I did come across a link to  
Mat  
Griffith’s site that might be helpful:  
[http://mattgriffith.net/PermaLink.aspx?guid=c8e38fa3-1b07-4d3d-ba1e-f8fb7a2846dc](http://mattgriffith.net/PermaLink.aspx?guid=c8e38fa3-1b07-4d3d-ba1e-f8fb7a2846dc)  
(Do you want to play with the latest REST stuff in  
Rails?[http://mattgriffith.net/PermaLink.aspx?guid=c8e38fa3-1b07-4d3d-ba1e-f8fb7a2846dc](http://mattgriffith.net/PermaLink.aspx?guid=c8e38fa3-1b07-4d3d-ba1e-f8fb7a2846dc)  
)

HTH

JY

---

<div class="post-metadata">

**Author:** ![pergesu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Post date:** [July 12, 2006, 2:52pm UTC](https://www.ruby-forum.com/t/so-what-is-rest-i-dont-get-how-it-fits-in-rails/98076/3 "2006-07-12T14:52:50Z")

</div>

> Does someone have an actual example of this? I saw DHH’s slides where  
> he said that you could have your app automatically respond with HTML,  
> XML, atom, whatever. So far I’ve found tons of discussion on REST and  
> CRUD in Rails, but I haven’t seen anything that actually shows me what  
> it all is.  
> \<…\>

Well, if you saw DHH slides, then you should have seen what it all is  
about.  
Maybe DHH’s talk will help? URL is here: [http://tinyurl.com/opl7c](http://tinyurl.com/opl7c)

## Regards, Rimantas

[http://rimantas.com/](http://rimantas.com/)

---

<div class="post-metadata">

**Author:** ![pergesu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Post date:** [July 12, 2006, 5:29pm UTC](https://www.ruby-forum.com/t/so-what-is-rest-i-dont-get-how-it-fits-in-rails/98076/4 "2006-07-12T17:29:05Z")

</div>

Sounds like you’re wondering about REST in general, not just in rails.  
If so, here’s a few  
links:

[http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm](http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm)  
(that’s the dissertation that started it all)

[http://www.xfront.com/REST-Web-Services.html](http://www.xfront.com/REST-Web-Services.html)

[http://www.xml.com/pub/a/2004/08/11/rest.html](http://www.xml.com/pub/a/2004/08/11/rest.html)

and there’s lots more out there!

b

---

<div class="post-metadata">

**Author:** ![pergesu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Post date:** [July 22, 2006, 1:31pm UTC](https://www.ruby-forum.com/t/so-what-is-rest-i-dont-get-how-it-fits-in-rails/98076/5 "2006-07-22T13:31:59Z")

</div>

I have a question about REST security.

Let’s say I have a URL like this  
[http://www.mycompany.com/clients/statements/show](http://www.mycompany.com/clients/statements/show) This URL shows the  
stament for a particular client. The client logs in, I know who the  
client is, I show them their statement.

Let’s say I want to expose this as a REST service so the client can  
pull the statement in XML. How should the client identify themselves?  
Should it be [http://username:removed\_email\_address@domain.invalid/](http://username:removed_email_address@domain.invalid/)… Or should be  
in the form of GET params? Some other way?

---

<div class="post-metadata">

**Author:** ![pergesu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Post date:** [July 22, 2006, 9:25am UTC](https://www.ruby-forum.com/t/so-what-is-rest-i-dont-get-how-it-fits-in-rails/98076/6 "2006-07-22T09:25:25Z")

</div>

On 7/12/06, Rimantas L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Does someone have an actual example of this? I saw DHH’s slides where  
> > he said that you could have your app automatically respond with HTML,  
> > XML, atom, whatever. So far I’ve found tons of discussion on REST and  
> > CRUD in Rails, but I haven’t seen anything that actually shows me what  
> > it all is.  
> > \<…\>
> 
> Well, if you saw DHH slides, then you should have seen what it all is about.  
> Maybe DHH’s talk will help? URL is here: [http://tinyurl.com/opl7c](http://tinyurl.com/opl7c)

Not really…I read the slides and watched his talk. Read a bunch of  
articles as well. I’d really just like to see some actual example  
code. Maybe someone could take the 15 minute blog and make it  
restful. I attempted to in order to learn this for myself, but  
couldn’t figure it out.

Pat

---

<div class="post-metadata">

**Author:** ![pergesu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Post date:** [July 22, 2006, 1:56pm UTC](https://www.ruby-forum.com/t/so-what-is-rest-i-dont-get-how-it-fits-in-rails/98076/7 "2006-07-22T13:56:28Z")

</div>

REST is a protocol like SOAP or XML-RPC.

A good source on REST with a few examples is on  
[http://ajaxpatterns.org/RESTful\_Service](http://ajaxpatterns.org/RESTful_Service)

Doesn’t explain how Rails is going to make it easyer to make REST but  
shoud explain the protocol.

On 7/12/06, Pat M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–
