Reply LinkBack Thread Tools Search this Thread
Old 01-08-2006, 10:57   #1 (permalink)
Luke Redpath
Barney army!
 
Luke Redpath's Avatar
 
Join Date: Mar 2003
Location: London
Posts: 692
[ANN] Unobtrusive Javascript for Rails 0.2

Unobtrusive Javascript for Rails is a Rails plugin that lets you attach behaviours to your page elements using pure Ruby with a little bit of CSS selector magic, in an unobtrusive manner, including patches to Rails' built-in AJAX/Javascript helpers to make them unobtrusive.

You can do something as simple as:

Code:
<div id="my_funky_box">Click Me!</div> <% apply_behaviour "#my_funky_box:click" do |page| page.alert "You clicked me!" end %>

Or even simpler:

Code:
<%= content_tag "div", "Click Me!", :onclick => "alert('Hello World!')" %>

All behaviours will be extracted to an external javascript file, generated at runtime, helping to ensure behaviour is separated from content and presentation.

More info:
http://www.lukeredpath.co.uk/index.p...-for-rails-02/

Subversion:
http://opensource.agileevolved.com/s...t/tags/rel-0.2

Plugin Documentation:
http://opensource.agileevolved.com/unobtrusivejs/
__________________
Luke Redpath .::. Software Engineer .::. Reevoo - Real Reviews From Real Customers
  Reply With Quote
Old 01-08-2006, 11:49   #2 (permalink)
cam
vague™
 
cam's Avatar
 
Join Date: Mar 2004
Location: Glasgow
Posts: 5,513
Nice one luke. Didn't get round to checking out the first release (I've only just started seriously using RoR in the past few weeks), but will definitely be having a look at this.
__________________
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8