Forum: Ruby on Rails Unobtrusive javascript...what if?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1e99128ebac5ca41c91940291d315332?d=identicon&s=25 Luke Redpath (lukeredpath)
on 2006-06-06 01:30
(Received via mailing list)
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:

[php]
<% form_remote_tag :controller => 'foo', :action => 'bar',
:unobtrusive => true %>

# which produces

<form id="form_foo_bar" action="/foo/bar" method="post">
[/php]

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. You will be able to find more information on
http://opensource.agileevolved.com in days to come, or stay tuned to
my blog tomorrow for more.

Apologies for the blatant promotion but we think people will like
this. People have asked for unobtrusive JS in Rails for a while. Could
it be here at last?

Cheers
Luke Redpath
http://www.lukeredpath.co.uk
http://opensource.agileevolved.com
1e99128ebac5ca41c91940291d315332?d=identicon&s=25 Luke Redpath (lukeredpath)
on 2006-06-06 01:52
(Received via mailing list)
Left the BB code tags from the forum post I made over at
SitePoint...how embarrasing ;)

On 6/6/06, Luke Redpath <contact@lukeredpath.co.uk> wrote:
>
>
> Luke Redpath
> http://www.lukeredpath.co.uk
> http://opensource.agileevolved.com
>


--
Cheers,
Luke Redpath
www.lukeredpath.co.uk
This topic is locked and can not be replied to.