Rails 1.1 has arrived!
RJS is a templating language that allows you to write JavaScript in a native Ruby style.
Some Good RJS Links
Cody Fauser's Intro to Rails' RJS
More on RJS and some of its advanced features
Rails JavaScript Generator Methods
Now, here's an absolute Must-Have RJS Debugging Snippet to drop into your rhtml page when you're playing around with this stuff:
RUBY:
-
<div id="debug">
-
</div>
-
<script type="text/javascript">
-
Ajax.Responders.register({
-
// log the beginning of the requests
-
onCreate: function(request, transport) {
-
new Insertion.Bottom('debug', '<p><strong>[' + new Date().toString() + '] accessing ' + request.url + '</strong></p>')
-
},
-
-
// log the completion of the requests
-
onComplete: function(request, transport) {
-
new Insertion.Bottom('debug',
-
'<p><strong>http status: ' + transport.status + '</strong></p>' +
-
'<pre>' + transport.responseText.escapeHTML() + '</pre>')
-
}
-
});
-
</script>
(via techno-weenie)
One Response to “Rails 1.1 and RJS Templates for Easily Ajaxifying your Webapp”
« It’s a bad time to start a company … that doesn’t make money
Designspotting »