Elia Schito

RESTful Rails, I might be wrong…

In Rails, Rails 1.2 rc1, RESTful rails, Ruby on Rails on November 28, 2006 at 1:51 am

Yes, the REST approach is very cool… but maybe not so usable.
You can POST things, and later PUT your changes, GET the result and then DELETE it.

Perhaps I’m missing something, but what if you have disabled JS on your browser?
You can’t delete nor update! And this sounds no good…
You really need to make your site suitable for non-ajax users while requiring them to be JS-enabled??

So where does go that few less “pain in the ass” (DHH words) while making our application for ajax and not-ajax users?

One last thing: is REST an acronym? and if not why it’s uppercase!
I hope it’s clear enough, and I’ll be happy to be wrong. Do not misunderstand, I’m not the Java-guy-of-complaints, I’m a proud rails developer.

  1. RESTful applications do not actually require that javasciprt is enabled:
    For deletes, use button_to instead of link to, and PUTs should not require javascript by default.

    You are correct in that browsers don’t support PUT/DELETE, however rails gets around this by wrapping the PUT/DELETEs in a POST with a :method attribute. This method attribute overrides the actual method you have provided.

    As for REST, it stands for Representational State Transfer.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: