Tag Archives: Ruby on Rails

Netbeans 6.5, with Ruby on Rails & JMaki

While writing some RoR code at home (or at least trying to grok the RoR way) I’ve alternating between using Emacs & Netbeans 6.5. Emacs is one true editor to rule them all, but what it’s lacking is code completion such as in Netbeans.

I was working on test RoR project last night with Emacs, and after a couple of hours imported the project into Netbeans 6.1 (a painless process). When I opened the “.erb” file I had been editing in Emacs, I noticed a panel on the right side of Netbeans titled “Palette”, that allows easy creation of html items such as tables & lists. It also, includes JMaki support for Dojo, Yahoo’s YUI, Scriptaculous, Spry, & JQuery, which allows quick and easy insertion of Ajax features using JMaki. After about 5 minutes of mucking around with various Ajax tables, I was easily able to replace a basic HTML table with a prettier, sortable, Yahoo YUI, Dojo, or JQuery tables.

Here’s a rough example, showing the difference between an list, and a sortable Yahoo YUI table created with Netbeans & JMaki:

Sample Tables

This is fairly powerful, and for those inexperienced with Ajax provides a quick and simple way to add Ajax features to a web-page or application as it provides Ruby constructs to create the necessary JavaScript and encapsulates the programmer away from the JavaScript. On the other hand, if your an “ace Ajax guru” this doesn’t allow you to directly write and access JavaScript, and the abstraction might seem like an hindrance.

Here’s a quickie overview showing how to use the JMaki features using a 6.1 beta and Ruby on Rails:

http://blogs.sun.com/arungupta/entry/jmaki_on_rails_reloaded_for

And a more recent generic overview using 6.1 & standard HTML/JSP:

http://www.netbeans.org/kb/docs/web/ajax-jmaki-quickstart.html

What’s also useful, is that JMaki in Netbeans creates the same looking code on your HTML rendering page, which means that if you can create JMaki widgets using Java you can easily do the same with RoR, and presumably with PHP.

If your haven’t looked at Netbeans 6.1 or haven’t tried Netbeans in a while, I do think there are some really useful features that sometime give it the edge over it main competitor Eclipse. I use both IDE’s regularly, and prefer Eclipse for Java & Perl development, but for RoR (especially on Linux) and Ajax features I think Netbeans is the winner (for now). However, there is a JMaki plugin for Eclipse which I haven’t tried that might be comparable (for Java applications).

Using both IDE’s could be a useful addition to a programmer’s toolbox. What I must do next is test Netbeans with a J2EE project created under Eclipse and see if I can use both IDE’s on the same project without problems. It be interesting to see if I can edit the Java code with Eclipse and then modify the view and add JavaScript/Ajax feature with Netbeans.

More information about JMaki can be found at:

https://ajax.dev.java.net/

Updated: Fixed version number, it’s Netbeans 6.5 and not 6.1. Fixed typos from writing tooo fast.