This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Luke Redpath (author)
Mon Apr 20 01:58:42 -0700 2009
blogdata / 005-unobtrusive-javascript-in-railswhat-if.markdown
:title: Unobtrusive Javascript in Rails...what if?
:published_on: Tue Jun 06 00:22:00 UTC 2006
Update 15 Feb 2009: The UJS plugin for Rails is no longer actively maintained but you can find the the source on github.
What if...you could produce accessible, unobtrusive javascript, using Rails built-in javascript/prototype helpers, with just one extra line of code in your layout, a plugin, and one small enhancement to the helpers? Something like this:
<% form_remote_tag :controller => 'foo', :action => 'bar', :unobtrusive => true %>
Which produces:
<form id="form_foo_bar" action="/foo/bar" method="post">
But which still acts as an ajax form? You would simply handle the response for ajax and non ajax requests using Rails' responds_to function.
In addition, what if you could attach javascript functionality to your page elements in a Behaviour-like fashion, but using pure Ruby, anywhere in your view, but loaded from an external Javascript file?
Sorry to tease. Stay tuned, we have something very cool to show off in the next day or two.







