The Ajax Experience - October 23 - 25, 2006 - No Fluff Just Stuff

Unobtrusive Ajax with Rails

The Ajax Experience

Boston · October 23 - 25, 2006

You are viewing details from a past event

About this Presentation

Learn how you can make your Ajax applications accessible to all by bringing unobtrusive DOM Scripting techniques to Rails. This presentation will introduce the concepts of progressive enhancement and graceful degradation and then go on to show how Rails can help you create applications with these techniques using a selection of available tools, techniques and plugins as well as real world examples from large applications.

Unobtrusive DOM Scripting techniques can help you create applications that are usable both with and without JavaScript enabled and therefore make your application available to a much wider audience such as those with older browsers, mobile browsers, those behind corporate firewalls and those using assistive technologies such as screen readers.

The key to this is decoupling the JavaScript behaviour layer from the structure and presentation of the HTML and CSS in the same way that we decouple the domain models from views and controllers. This way we can create a basic, working application then layer on the JavaScript/AJAX based enhancements to the interface after. We achieve this separation by programmatically attaching events to the elements on the screen rather than writing JavaScript directly into our HTML pages as most Rails applications do. This practice, referred to as progressive enhancement, means that should the JavaScript enhancements be unsupported or fail the user still can still operate the application.

This presentation will introduce the concepts of progressive enhancement and graceful degradation and then go on to show how Rails can help you create applications with these techniques using a selection of available tools, techniques and plugins. This is not a solely JavaScript focussed presentation though, it also looks at using Rails to implement these techniques in the most elegant way possible. Techniques include use of respond_to to automatically serve RJS responses to XHR request while still serving HTML response to regular requests, adjusting the Rails JavaScript helpers to act unobtrusively, use of several plugins, including the Unobtrusive JavaScript plugin and the Low Pro library and many more. Throughout the presentation we'll be looking at plenty of examples and real world implementations.

Dan Webb

Vivabit Developer and Co-author of the Unobtrusive JavaScript Plugin For Rails

Dan Webb is a Web Application Developer working for Vivabit for which he is developing Eventwax, an RoR based event management system. More recently he has co-authored the Unobtrusive JavaScript Plugin For Rails and the Low Pro extention to Prototype.

He's also a renowned JavaScript expert who spoken at @media 2006, written for A List Apart, HTMLDog and Sitepoint and is a member of, UK web design group, the Brit Pack. He blogs regularly about Ruby, Rails and JavaScript at Vivabit's blog, The Web's Bollocks.