Forum: Ruby on Rails How to use Rails and REST

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ea627ef000ec92c6cdd5a4c14075e740?d=identicon&s=25 Dan Kubb (Guest)
on 2006-04-22 02:49
(Received via mailing list)
Hi,

I just wrote an article on how to easily create a REST API for
Ruby on Rails applications:

   http://www.xml.com/pub/a/2006/04/19/rest-on-rails.html

It describes how to create everything from the ground up and includes
information on testing your API too.

--

Thanks,

Dan Kubb
D0cd6b10e01bacb976b3b815a9c660bc?d=identicon&s=25 Alex Wayne (Guest)
on 2006-04-22 04:08
Dan Kubb wrote:
> Hi,
>
> I just wrote an article on how to easily create a REST API for
> Ruby on Rails applications:
>
>    http://www.xml.com/pub/a/2006/04/19/rest-on-rails.html
>
> It describes how to create everything from the ground up and includes
> information on testing your API too.
>
> --
>
> Thanks,
>
> Dan Kubb

Rock solid stuff, did the whole thing.  Especially awesome for Code to
Test Ratio: 1:2.7 which for a tutorial is the most tests I have seen.

One critique is I think it could use a bit of info about REST.  I didn't
know much about REST before this, so I wasn't sure why I was doing these
things.  Maybe just a paragraph about the principals and how it uses the
request types and stuff.
Ea627ef000ec92c6cdd5a4c14075e740?d=identicon&s=25 Dan Kubb (Guest)
on 2006-04-22 09:11
(Received via mailing list)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Alex,

>> I just wrote an article on how to easily create a REST API for
>> Ruby on Rails applications:
>>
>>    http://www.xml.com/pub/a/2006/04/19/rest-on-rails.html
>
> Rock solid stuff, did the whole thing.  Especially awesome for Code to
> Test Ratio: 1:2.7 which for a tutorial is the most tests I have seen.

Thank you.  I wanted to provide a set of test cases for a simple
application so that I could enhance it in further articles, adding
conditional GET support and supporting HTML and JSON in addition
to XML.  I haven't written it yet, but I think I can do it with
maybe 5 to 10 lines of controller code, and maybe a dozen or so
lines of view and test code.

> One critique is I think it could use a bit of info about REST.  I
> didn't
> know much about REST before this, so I wasn't sure why I was doing
> these
> things.  Maybe just a paragraph about the principals and how it
> uses the
> request types and stuff.

To tell you the truth when I saw the article I was disappointed that
the part where I gave real world examples of why REST architecture is
important was edited out.  IMHO the article is a little weak without
it -- people need to be told the *why* behind something before being
told the *what*.

Ah well, it was my favorite part of the article so I'm posting it
here anyway ;)  Let me know what you think:

>> The problem was that many applications were designed so that
>> from side effects. There's a part of the HTTP specification that
>> became a standard feature in mainstream browsers someday because
>> they ever happen.
This would've appeared immediately between the second and third
paragraphs of the article.  Its a little rough, but I think it
makes the point a little better..

- --

Thanks,

Dan
__________________________________________________________________

Dan Kubb
Autopilot Marketing Inc.

Email: dan.kubb@autopilotmarketing.com
Phone: 1 (604) 820-0212
Web:   http://autopilotmarketing.com/
vCard: http://autopilotmarketing.com/~dan.kubb/vcard
__________________________________________________________________



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (Darwin)

iD8DBQFESdZt4DfZD7OEWk0RAormAJoCDzXsNBvxdwC9VrD15Qq6OABTggCfTmaf
LQiyipOr41IhGlb2WDspZ0I=
=gRS5
-----END PGP SIGNATURE-----
A8e90e6f310e36963dfd432a66e2e558?d=identicon&s=25 Berlin Brown (Guest)
on 2006-04-22 09:54
(Received via mailing list)
Dan Kubb wrote:

>>
>
> the part where I gave real world examples of why REST architecture is
>>> illustrates a perfect example where going against the grain will
>>> Accelerator follows those state changing links it causes
>>> specifications, either intentionally or ignorantly.
>>> Its not just prefetching we should be thinking about. In the
> paragraphs of the article.  Its a little rough, but I think it
> Autopilot Marketing Inc.
> Version: GnuPG v1.4.2.2 (Darwin)
>
> iD8DBQFESdZt4DfZD7OEWk0RAormAJoCDzXsNBvxdwC9VrD15Qq6OABTggCfTmaf
> LQiyipOr41IhGlb2WDspZ0I=
> =gRS5
> -----END PGP SIGNATURE-----
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
Is all the code provided?

--
Berlin Brown
(ramaza3 on freenode)
http://www.newspiritcompany.com
http://www.newspiritcompany.com/newforums
also checkout alpha version of botverse:
http://www.newspiritcompany.com:8086/universe_home
This topic is locked and can not be replied to.