Unobtrusive Javascript
August 9th, 2006
It was a good evening yesterday at the LRUG meeting in Clerkenwell (Skills Matter). Both of the presentations were interesting, but it was the talk by Tom Armitage on ‘Ruby on Rails from the Other Side of the tracks’ that sparked my interests most. Although, I have to admit it wasn’t really the content on designers and programmers working in perfect harmony that got my attention as much as the talk about the Rails javascript helpers and the nasty javascript that they produce. This is outlined in a good article by Dan Web – ‘Rails is the Devil on you Client Side Shoulder’
Tom mentioned a plugin that has recently been released by Luke Redpath and Dan Web which (in Luke’s words) “allows you to use CSS selectors to attach Javascript events to your page. This plugin allows you to make use of the event:Selectors library, but in Ruby, directly from your controller or view and have the resulting behaviour rules dynamically generated at runtime in an external javascript file.”. This seems to me to be a much nicer way of doing things, nice one Luke and Dan.