# RESTful and "graceful" degrade if javascript is disabled

**URL:** <https://www.ruby-forum.com/t/restful-and-graceful-degrade-if-javascript-is-disabled/111872>\
**Category:** Rails\
**Created:** [August 12, 2007, 8:42pm UTC](https://www.ruby-forum.com/t/restful-and-graceful-degrade-if-javascript-is-disabled/111872 "2007-08-12T20:42:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pedz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/839c29/32.png) [@pedz](https://www.ruby-forum.com/u/pedz)\
**Post date:** [August 12, 2007, 8:42pm UTC](https://www.ruby-forum.com/t/restful-and-graceful-degrade-if-javascript-is-disabled/111872/1 "2007-08-12T20:42:55Z")

</div>

I’m trying to resolve a sort of personal conflict.

On the one hand, I want to use the new nifty javascript things. In the  
case of the application I’m writing, it would make the user interface  
usable and I can’t figure out how to do a usable user interface without  
javascript.

But on the other hand, I have heard loud and clear that a “good” site  
should degrade gracefully if javascript is disabled. But something kept  
buzzing around in my head about something that does not really happen,  
it actually invokes a small piece of javascript… yada yada yada… I  
couldn’t remember what it was.

I figured it out. For one, the “delete” links for a RESTful application  
invoke javascript ‘onclick’ to submit the request and add in the  
“:method =\> delete”. For curiosity, I disabled javascript and poked the  
link to see how did it work if javascript was disabled. Answer: it does  
nothing – really. It sends a request for the page that you are  
currently looking at.

So… is this considered a graceful degradation? There is no way to  
delete objects in a normlal Rails RESTful implementation. It doesn’t  
even say “Loser!”. It just redraws the screen.

pedz

---

<div class="post-metadata">

**Author:** ![pedz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/839c29/32.png) [@pedz](https://www.ruby-forum.com/u/pedz)\
**Post date:** [August 12, 2007, 11:30pm UTC](https://www.ruby-forum.com/t/restful-and-graceful-degrade-if-javascript-is-disabled/111872/2 "2007-08-12T23:30:36Z")

</div>

On 8/12/07, Perry S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> buzzing around in my head about something that does not really happen,  
> So… is this considered a graceful degradation? There is no way to  
> delete objects in a normlal Rails RESTful implementation. It doesn’t  
> even say “Loser!”. It just redraws the screen.

Nope. Just like with ‘unrestful’ apps, you need to specify a valid  
fallback page. If there’s no javascript, the onclick is ignored, and  
whatever is in the href attribute is followed. This could be pointed  
at some sort of delete confirmation page if you want.

–  
Rick O.  
[http://lighthouseapp.com](http://lighthouseapp.com)  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)
