With Rails 3 Comes The End Of Obtrusive JavaScript (please!)
Ruby on Rails 3 makes huge use of custom attributes using the data-* from the HTML 5 spec. This is a miniature class that will grab all anchor tags with “data-confirm”, pull that attributes value and stop the default event from firing till after they click “Ok”. If they click “Cancel” nothing happens.
John Resig has great post on these custom attributes. You can find it on his blog here.
Usage
JavaScript
var confirmations = new Confirmootion({
attribute: 'data-confirm'
});






One Response
nice post