<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom">
    <title type="html">Insider Scoop From the Tutorial Divas</title>
    <subtitle type="html">The divas talk about the new and cool features of the NetBeans IDE</subtitle>
    <id>http://blogs.sun.com/divas/feed/entries/atom</id>
            
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/" />
        <updated>2009-11-03T15:37:03-08:00</updated>
    <generator uri="http://roller.apache.org" version="4.0.1.1 (BSC) (20091027075624)">Apache Roller</generator>
        <link rel="self" href="http://feeds.feedburner.com/InsiderScoopFromTheTutorialDivas" type="application/atom+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry>
        <id>http://blogs.sun.com/divas/entry/a_new_day_a_new</id>
        <title type="html">A New Day a New Blog</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/a_new_day_a_new" />
        <published>2009-11-03T15:37:03-08:00</published>
        <updated>2009-11-03T15:37:03-08:00</updated> 
        <category term="/Personal" label="Personal" />
        <category term="cloud" scheme="http://roller.apache.org/ns/tags/" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;img src="http://blogs.sun.com/divas/resource/IMG_3903_edited.jpg"&gt;&lt;p&gt;It has been almost two years since the divas were split up -- Gail works on JavaFX and I work on Cloud Services. I have been thinking about starting a new blog ever since, and I finally got around to doing it. From now on, I will be posting at &lt;a href="http://altocirrus.wordpress.com"&gt;altocirrus.wordpress.com&lt;/a&gt;. In addition to talking about NetBeans, Ruby, and Rails, I will be getting into cloud applications and other bits of cloud information that I come across.&lt;/p&gt;
&lt;p&gt;- diva#2&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/QyF48stuago" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/personal_connections</id>
        <title type="html">Personal Connections</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/personal_connections" />
        <published>2009-10-08T19:16:58-07:00</published>
        <updated>2009-10-08T19:16:58-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="alohaonrails" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;img align="left" src="http://blogs.sun.com/divas/resource/IMG_1148.jpg"/&gt;
&lt;p&gt;
When I heard about a &lt;a href="http://www.alohaonrails.com/"&gt;Aloha on Rails&lt;/a&gt;, I jumped on the chance to attend a local conference. Having been to several JavaOne conferences, I knew how helpful they were they were for learning best practices, discovering what people were adopting, and getting a view of what's coming down the pike. I definitely got all of that, but I unexpectedly took away a lot more.
&lt;/p&gt;
&lt;p&gt;
For one, it was my first "local" conference (well it is an airplane ride away, but it still felt local to me). I was happy to find that about half the people I talked to are developers in Hawaii and a lot of business cards were exchanged with the hope that we could all meet again at Aloha on Rails 2.
&lt;/p&gt;
&lt;p&gt;
Second, it was a small conference. After the first day and a nice pau nana party put on by Agathon Group (thanks guys), everyone was starting to look familiar and we were having great discussions. The theme of the conference was talk story, and that definitely was going on both in the conference rooms and outside. Small conferences also mean that the speakers are easily accessible. Here were people that I have been following for years, like Chad Fowler, Obie Fernandez, Charles Nutter, and Yehuda Katz, that I got to meet face-to-face, as well as people I hadn't heard about but are now on my follow list, such as &lt;a href="http://www.snowgiraffe.com/tech/"&gt;Blythe Dunham&lt;/a&gt;, &lt;a href="http://onestepback.org/"&gt;Jim Weirich&lt;/a&gt; (have you learned to play Hawaiian Lullabye on your uke yet?), and Desi McAdam, founder of &lt;a href="http://www.devchix.com/"&gt;DevChix&lt;/a&gt;.  I don't know if it is because everyone was a Rails developer (and following the Rails way), the aloha atmosphere, or what, but it really was a nice crowd of people to hang with.
&lt;/p&gt;
&lt;p&gt;
Last, while there was a lot of good info about how to do Rails right and what is the best stuff to use, the bigger take away for me was how important it is to develop personal connections and get involved in communities. That seemed to be the theme spreading through all the talks...how good things happen when you connect with and share with people outside of your daily job tasks. So that is my new mantra...Get Connected. The first thing I did when I returned to work was to join an online community of tech people on the Big Island, and I have already exchanged emails with a couple of people (whoo hoo, I am not alone). Next, I need to get involved with an open source community. It might be something in the cloud, or some Rails project (maybe a cloud one), I don't know. If you have suggestions, pass them on.
&lt;/p&gt;
&lt;p&gt;
So, anyway, I am pretty energized by the small conference experience. If you haven't done one, you gotta try it. And a BIG thanks to &lt;a href="http://sethladd.com/"&gt;Seth&lt;/a&gt; for making it happen. Great job.
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/Tlp_D2M_Es4" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/rails_generate_window_not_appearing</id>
        <title type="html">Rails Generate Window Not Appearing With JDK 6u12</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/rails_generate_window_not_appearing" />
        <published>2009-02-19T18:43:41-08:00</published>
        <updated>2009-02-19T18:43:41-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="generate" scheme="http://roller.apache.org/ns/tags/" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;p&gt;A few people have reported that when they right-click a Rails project node in the NetBeans IDE and choose Generate from the pop-up menu, nothing happens. One user reported that the problem is caused by an interaction with the Java Development Kit (JDK) 6u12. To fix this problem, download a different version of the JDK, such as 6u11, and point the IDE to that installation. See my &lt;a href="http://blogs.sun.com/divas/entry/telling_netbeans_ide_which_jdk"&gt;previous blog&lt;/a&gt; for instructions on how to use a different JDK.
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/QHvPJBi95G8" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/using_gems_with_jruby</id>
        <title type="html">Using Gems With JRuby</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/using_gems_with_jruby" />
        <published>2009-02-18T16:07:51-08:00</published>
        <updated>2009-02-18T16:07:51-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="gems" scheme="http://roller.apache.org/ns/tags/" />
        <category term="jruby" scheme="http://roller.apache.org/ns/tags/" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;p&gt;If you are new to JRuby, you might not know that you cannot use a gem that has native extensions with JRuby, unless that gem builds its library in a platform-neutral manner.  When you use the JRuby gem executable to try to add such a gem to your repository, you will get a message like this.
&lt;/p&gt;
&lt;pre&gt;
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
    ERROR: Failed to build gem native extension.

C:/jruby/jruby-1.1.5/bin/jruby.bat extconf.rb install rmagick --no-rdoc --no-ri
C:/jruby/jruby-1.1.5/lib/ruby/1.8/mkmf.rb:7: JRuby does not support native extensions. Check wiki.jruby.org for alternatives. (NotImplementedError)
    from C:/jruby/jruby-1.1.5/lib/ruby/1.8/mkmf.rb:1:in `require'
    from extconf.rb:1
Gem files will remain installed in C:/rubyrepos/jrubygemrepo/gems/rmagick-2.9.1 for inspection.
Results logged to C:/rubyrepos/jrubygemrepo/gems/rmagick-2.9.1/ext/RMagick/gem_make.out
&lt;/pre&gt;
&lt;p&gt;
As you would guess, you then need to hunt for an equivalent gem that will work with JRuby.  Anything with "pure Ruby" in its description is a good bet. In the case of RMagick, there is a &lt;a href="http://kenai.com/projects/rmagick4j/pages/Home"&gt;RMagick4j&lt;/a&gt;.  Some other examples JRuby compatible gems are
Mongrel, Hpricot, ImageVoodoo, JRuby-OpenSSL, JRuby/LDap, json_pure, and postgres_pr.&lt;/p&gt;
&lt;p&gt;If you are developing with both Ruby and JRuby, you might want to create a separate repository that holds the gems that work for both implementations, and then put that repository into your &lt;tt&gt;GEM_PATH&lt;/tt&gt;. That way, you won't have to install the gem twice. If you are using NetBeans IDE, use the Ruby Platform Manager to add the repository to a platform's &lt;tt&gt;GEM_PATH&lt;/tt&gt;.
&lt;/p&gt;
&lt;p&gt;If you want to require a certain gem based on whether you are running on JRuby, you can check whether &lt;tt&gt;JRUBY_VERSION&lt;/tt&gt; is defined.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/Zpcih83dk1U" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/telling_netbeans_ide_which_jdk</id>
        <title type="html">Telling NetBeans IDE Which JDK to Use</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/telling_netbeans_ide_which_jdk" />
        <published>2009-02-12T17:12:41-08:00</published>
        <updated>2009-02-12T17:12:41-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="jdk" scheme="http://roller.apache.org/ns/tags/" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;p&gt;A customer has filed a &lt;a href="http://www.netbeans.org/issues/show_bug.cgi?id=157326"&gt;bug&lt;/a&gt; about the Generator menu item not working for NetBeans Rails projects if the IDE is using version 6u12 of the Java Development Kit (JDK) software.&lt;/p&gt;
&lt;p&gt;Not knowing how to tell the IDE to use a different JDK, the user reinstalled the NetBeans software.&lt;/p&gt;
&lt;p&gt;If you don't know already, there is no need to go to such lengths. Here are two ways to tell the IDE which JDK to use.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;b&gt;Specify the JDK in the startup command.&lt;/b&gt; Modify the command that starts the IDE to include the &lt;tt&gt;--jdkhome&lt;/tt&gt; option pointing to the desired JDK. For example:
&lt;/p&gt;
&lt;p&gt;
&lt;tt&gt;&lt;i&gt;netbeans-install-dir&lt;/i&gt;/bin/netbeans.exe --jdkhome "%JAVA_HOME%"&lt;/tt&gt;
&lt;/p&gt;
&lt;p&gt;The above example uses the &lt;tt&gt;%JAVA_HOME%&lt;/tt&gt; environment
variable, which is set to &lt;tt&gt;C:\Program Files\Java\jdk1.6.0_10&lt;/tt&gt;, but you can just supply
in the path instead. If it has spaces in it, put the path in 
quotes (that's why the environment variable is in quotes).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;b&gt;Specify the desired JDK in the &lt;tt&gt;netbeans.conf&lt;/tt&gt; file.&lt;/b&gt; Open the &lt;tt&gt;&lt;i&gt;netbeans-install-dir&lt;/i&gt;/etc/netbeans.conf&lt;/tt&gt; file, look for the following option and set it to point to the desired JDK. You might need to unremark the setting.
&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;netbeans_jdkhome="&lt;i&gt;path-to-jdk&lt;/i&gt;"&lt;/tt&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;p&gt;If you are not able to modify the &lt;tt&gt;netbeans.conf&lt;/tt&gt; file because you are sharing the installation or you don't have permission, you can instead create an &lt;tt&gt;etc&lt;/tt&gt; folder in your NetBeans &lt;i&gt;userdir&lt;/i&gt; and put a &lt;tt&gt;netbeans.conf&lt;/tt&gt; file in the &lt;tt&gt;etc&lt;/tt&gt; folder. You only need to put in the options that you want to override. For more information see the 
&lt;a href="http://wiki.netbeans.org/FaqNetbeansConf"&gt;How do I make my custom startup parameters permanent?&lt;/a&gt; FAQ.
&lt;/p&gt;

&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/Ja8KA0m759E" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/installing_your_own_jruby_to</id>
        <title type="html">Installing Your Own JRuby to Use With the NetBeans IDE</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/installing_your_own_jruby_to" />
        <published>2009-02-09T18:13:20-08:00</published>
        <updated>2009-02-09T18:13:20-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="jruby" scheme="http://roller.apache.org/ns/tags/" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">
&lt;p&gt;The Ruby support for NetBeans includes a bundled JRuby installation. This is great for quickly getting started with the IDE, but I recommend that you download and install your own version of JRuby and use that one instead. There are a few reasons for doing so, one of which is that the next time you install a NetBeans version, you will get a new bundled JRuby installation,
most likely a different version. If you have added gems to the old bundled JRuby, you will have to reinstall those gems to the new bundled JRuby.&lt;/p&gt;
&lt;p&gt;Another reason is when you want to work with more recent JRuby version. For this reason alone, it is good to learn how to install JRuby and register it with the IDE. Below are the steps that I do to add a JRuby installation.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;First download JRuby from the &lt;a href="http://jruby.codehaus.org/Getting+Started"&gt;JRuby site&lt;/a&gt; and
install it by following the Getting Started instructions.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;TIP:&lt;/b&gt; If you are downloading the 6RC1 version, after you unpack it, rename the directory from &lt;tt&gt;jruby-1.1.6RC1&lt;/tt&gt; to &lt;tt&gt;jruby-1.1.6&lt;/tt&gt;. For some reason, The GlassFish app server barfs on the &lt;tt&gt;RC1&lt;/tt&gt; in the path name.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Put JRuby's bin in your environment path. I remember reading some recommendation that if you have both Ruby and JRuby,
put JRuby after Ruby in the path. Because I switch out JRuby versions often, I created a JRUBY environment variable that
points to the bin directory of the JRuby that I am working with, and I added the JRUBY environment variable to my path. To test it, I type &lt;tt&gt;jruby -v&lt;/tt&gt; on the command line.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now you can register your new JRuby installation with the NetBeans IDE. Choose Tools &amp;gt; Ruby Platforms from
the main menu. Choose Add Platform, and navigate to and select the JRuby executable in the &lt;tt&gt;bin&lt;/tt&gt; directory.
If you are on Windows, this is &lt;tt&gt;jruby.bat&lt;/tt&gt;. Click Open.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This step is optional, and I don't suggest it if you are new to Ruby and installing gems. I get tired of having to install the same gems over and over every time I upgrade JRuby, so
I create a separate repository (outside of the installation folder) for the gems. If you want to do this,
click the Browse button to the right of the Gem Home text box, type the path to your gem repository,
and click Open. (If you
don't have one yet, use the New Folder button in the dialog box to create it, such as &lt;i&gt;some-ruby-repo-path&lt;/i&gt;&lt;tt&gt;/jrubygemrepo&lt;/tt&gt;. When you click Open, it will ask if you want to set up
your repository there, click OK.)
&lt;/p&gt;
&lt;p&gt;Next click the Add button to the right of the Gem Path text box and add the repository to the gem path.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You will need the debugger gems. Follow the instructions on the &lt;a href="http://wiki.netbeans.org/RubyDebugging#section-RubyDebugging-JRuby"&gt;NetBeans Ruby Debugger&lt;/a&gt; wiki page.
Make sure you get the correct versions -- the ones noted on the wiki page. If you opted for a separate gems repository
in the previous step, then add &lt;tt&gt;--install-dir&lt;/tt&gt; &lt;i&gt;your-repo-path&lt;/i&gt; to the gem install
commands.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Next, I install Rails. You can do this from
the command line, or from the IDE's Ruby Gems Manager, which is available from the main menu. When you open the Ruby
Gems manager, click the Settings tab and select Fetch All Versions so that you
have a choice of which version to download. Then click the New Gems tab
and click Reload Gems. Select Rails and click Install. You will be asked
to select a version.
If you want to follow the 6.5 tutorials,
be sure to install Rails 2.1.2 or 2.1.0 because you need Rails 2.1.* for the tutorials. Version 2.1.1 is not compatible with JRuby.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
Some other gems you might want to install right away are jruby-openssl, Active Record JDBC Adapter, and the JDBC
adapters for the databases that you use. See &lt;a href="http://www.netbeans.org/kb/docs/ruby/setting-up.html#dbservers"&gt;
Using Database Servers With JRuby&lt;/a&gt; for more information about the JDBC adapters.
&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Hopefully, this is complete enough to get you going. Please add comments if you have suggestions or steps to add.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/4glnJpbPlig" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/no_such_file_to_load</id>
        <title type="html">no such file to load -- mysql  </title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/no_such_file_to_load" />
        <published>2009-02-03T13:56:29-08:00</published>
        <updated>2009-02-03T13:56:29-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="mysql" scheme="http://roller.apache.org/ns/tags/" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;p&gt;Rails never fails me. As soon as I publish a series of 
tutorials for a NetBeans release, a new Rails release comes
out which breaks my tutorials (and, apparently, most everyone
else's). Gratefully, some customers
took the time to click the Feedback button at the end
of our tutorials to let us know the tutorials were no longer working.
One customer wrote:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;
"When trying to create the database following the steps indicated, I got an error indicating
the mysql gem had been removed from Rails 2.2.2 and that I should install the mysql gem.
(Note from me: the actual error message is 
"The bundled mysql.rb driver has been removed from Rails 2.2. Please 
install the mysql gem and try again: gem install mysql.")
However, that gem is also native and can't be installed with JRuby (the misleading
directive to do so from NetBeans was really annoying)."&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;I have to agree that this is indeed REALLY annoying. However, the "misleading
directive" comes from Rails, and not from NetBeans. And, since Rails 2.2
came out after NetBeans 6.5, this was an unexpected message.&lt;/p&gt;
&lt;p&gt;While the directive may be true for Ruby, it is not true
for JRuby, because the the MySQL adapter is included with JRuby. 
In addition, as the user pointed out,
you can't install the mysql gem with JRuby because you cannot use
any gems that build native C libraries during the install process,
and that includes the mysql gem. &lt;/p&gt;
&lt;p&gt;I did some googling and found two solutions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Use the activerecord-jdbcmysql-adapter.&lt;/b&gt; You can find
the instructions on how to do that &lt;a href="http://www.netbeans.org/kb/docs/ruby/setting-up.html#dbservers"&gt;here&lt;/a&gt;.
&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Copy the MySQL driver to your project's &lt;tt&gt;lib&lt;/tt&gt; folder.&lt;/b&gt; If you have an older Rails version, you can copy the Ruby MySQL driver
(&lt;tt&gt;mysql.rb&lt;/tt&gt;) from 
&lt;tt&gt;&lt;i&gt;rails-install-dir&lt;/i&gt;/gems/activerecord-&lt;i&gt;version&lt;/i&gt;/lib/active_record/vendor/mysql.rb&lt;/tt&gt;
to the project's &lt;tt&gt;lib&lt;/tt&gt; directory. Unfortunately, you have to do this for 
every JRuby project.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If anyone else has any other solutions, please post a comment.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;P.S.&lt;/b&gt; For all you Ruby programmers, when you try out a tutorial, you really should 
pay attention to what gem versions the tutorial was written for. Gem releases such
as Rails and RSpec are not always backwards compatible, so there is a chance
that the tutorial will not work 
with releases that came out after the tutorial was written.
&lt;/p&gt;

&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/yX-GQ4_ROTA" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/our_netbeans_ruby_book_is</id>
        <title type="html">Our NetBeans Ruby Book is Done!</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/our_netbeans_ruby_book_is" />
        <published>2008-12-09T12:41:22-08:00</published>
        <updated>2008-12-09T12:41:22-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="glassfish" scheme="http://roller.apache.org/ns/tags/" />
        <category term="jruby" scheme="http://roller.apache.org/ns/tags/" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <category term="warbler" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;a href="http://www.apress.com/book/view/1430216360"&gt;&lt;image src="http://www.apress.com/resource/bookcover/9781430216360?size=medium" border="0" align="left"&gt;&lt;/a&gt;&lt;p&gt;If you have been wondering why this blog has been so quiet for so long, it is because I was working on a NetBeans Ruby book with &lt;a href="http://weblogs.java.net/blog/bleonard/"&gt;Brian Leonard&lt;/a&gt;. Brian asked me to help him with the book and I am glad that he did. It was a good experience working with Brian and I am happy with how it turned out.&lt;/p&gt;
&lt;p&gt;The book is published by Apress and is available in ebook and hard copy
&lt;a href="http://www.apress.com/book/view/1430216360"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In the book we delve into the details of how to use the IDE to develop Ruby and Ruby on Rails projects. If you haven't tried &lt;a href="http://www.netbeans.org/"&gt;NetBeans IDE 6.5&lt;/a&gt; yet, I am sure you will find the book helpful from start to finish. For those who are upgrading, the book helps you to learn about the new features. Even if you are an experienced NetBeans user, I bet you will find stuff you don't know, especially in the chapters on using the editor and on customizing the IDE.&lt;/p&gt; 
&lt;p&gt;We got a lot of help from a lot of people along the way. Foremost were the NetBeans Ruby engineers &lt;a href="http://blogs.sun.com/emononen/"&gt;Erno Mononen&lt;/a&gt; and &lt;a href="http://blogs.sun.com/martink/"&gt;Martin Krauskopf&lt;/a&gt; who patiently answered every question. Erno was also the book's technical reviewer. &lt;a href="http://blogs.sun.com/tor/"&gt;Tor Norbye&lt;/a&gt; contributed to the editing chapter, and &lt;a href="http://blog.nicksieger.com/"&gt;Nick Sieger&lt;/a&gt; helped with the chapters about &lt;a href="http://kenai.com/projects/warbler"&gt;Warbler&lt;/a&gt; and JRuby. When it came to GlassFish, we leaned on &lt;a href="http://blogs.sun.com/arungupta/"&gt;Arun Gupta&lt;/a&gt; and Peter Williams.&lt;/p&gt;
&lt;p&gt;I would also like to thank the frequent posters to the users@ruby.netbeans.org alias, such as Bharat, Anthony, and James,  who provided a good user perspective and answered my requests for information about best practices.&lt;/p&gt;
&lt;p&gt;Last, I want to show appreciation for my managers Sophia and Dave for their support all the way through the process, and for my husband who took over most of my chores without complaint so I could spend my spare time working on the book.&lt;/p&gt;

&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/JY5oTRvYmb4" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/fixing_the_rails_requires_rubygems</id>
        <title type="html">Fixing the Rails requires RubyGems &gt;= 1.3.1 Error</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/fixing_the_rails_requires_rubygems" />
        <published>2008-12-08T11:45:43-08:00</published>
        <updated>2008-12-08T15:07:41-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;p&gt;Many of you who are trying out the NetBeans IDE Ruby support are running into the following error message:&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;Rails requires RubyGems &gt;= 1.3.1 (you have 1.2.0). Please `gem update
--system` and try again.&lt;/tt&gt;
&lt;/p&gt;

&lt;p&gt; This is not a NetBeans error message. It is generated by the Rails framework. This error message happens if you upgrade to Rails 2.2.2.&lt;/p&gt;
&lt;p&gt;To compound the frustration, it seems that the suggested command &lt;tt&gt;gem update --system&lt;/tt&gt; does not work on all versions of Ruby Gems. When you try the command, you get a message that there is nothing to update. Fortunately, there is a work around.&lt;/p&gt;
&lt;p&gt;Here is one way to fix this Rails/Ruby Gems version mismatch. If you have more than one Ruby installation (for example, you have the JRuby that is installed with the IDE and you have a separate MRI Ruby installation), you need to run the command for each installation. Note that the path to the bundled JRuby &lt;tt&gt;bin&lt;/tt&gt; directory is &lt;tt&gt;&amp;lt;&lt;i&gt;netbeans-install-dir&lt;/i&gt;&amp;gt;/ruby2/jruby-1.1.4/bin&lt;/tt&gt;. &lt;/p&gt;
&lt;p&gt;In the following steps, replace &lt;tt&gt;ruby&lt;/tt&gt; with &lt;tt&gt;jruby&lt;/tt&gt; if you are updating your JRuby installation.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open a terminal window and change (&lt;tt&gt;cd&lt;/tt&gt;) to the JRuby or Ruby &lt;tt&gt;bin&lt;/tt&gt; directory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Type &lt;tt&gt;ruby -S gem --version&lt;/tt&gt;
&lt;p&gt;If the version is 1.3.1, then that installation has already been updated and you are done. Otherwise, continue.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Type &lt;tt&gt;ruby -S gem install rubygems-update &lt;/tt&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Type &lt;tt&gt;ruby -S update_rubygems&lt;/tt&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To ensure that the update happened, type &lt;tt&gt;ruby -S gem --version&lt;/tt&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/JGWy5cZkrV4" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/quick_note_about_what_s</id>
        <title type="html">Quick Note about What's New in NetBeans IDE 6.5 Ruby Support</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/quick_note_about_what_s" />
        <published>2008-11-20T09:04:14-08:00</published>
        <updated>2008-11-20T09:04:14-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;p&gt;
Here are some of the new features that you will find in the 6.5 release of the NetBeans IDE Ruby Support.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;New Run/Debug Rake Task action and dialog box&lt;/li&gt;
&lt;li&gt;New Test Runner including Autotest support&lt;/li&gt;
&lt;li&gt;Support for Warbler instead of Goldspike, so now
can WAR up Ruby projects as well as JRuby projects&lt;/li&gt;
&lt;li&gt;Integrated GlassFish V3 deployment&lt;/li&gt;
&lt;li&gt;Additional debugging support: exception &amp; conditional breakpoints&lt;/li&gt;
&lt;li&gt;New options in Settings tab of Gems Manager&lt;/li&gt;
&lt;li&gt;Mark Occurrences Ctrl-Up and Ctrl-Down&lt;/li&gt;
&lt;li&gt;Rubinius support&lt;/li&gt;
&lt;li&gt;Support for script/destroy&lt;/li&gt;
&lt;li&gt;Ability to set the Rails version at project creation&lt;/li&gt; 
&lt;li&gt;Ability to set editor formatting on a project-by-project basis using the Project Properties dialog box&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/VUivPknWG30" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/my_favorite_netbeans_features</id>
        <title type="html">My Favorite NetBeans Features</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/my_favorite_netbeans_features" />
        <published>2008-11-18T14:24:53-08:00</published>
        <updated>2008-11-18T14:24:53-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;p&gt;There has been one NetBeans feature that has been a life saver for me. It was around in 6.1, but I didn't know about it until I saw &lt;a href="http://weblogs.java.net/blog/bleonard/"&gt;Brian Leonard&lt;/a&gt; use it in our &lt;a href="http://weblogs.java.net/blog/bleonard/"&gt;JavaOne hands-on lab&lt;/a&gt; to figure out what a lab participant had done wrong -- local history. He used it to back track what the guy had done to see where he deviated from the lab.&lt;/p&gt;
&lt;p&gt;As a tech writer, I spend a lot of time trying to figure out how to do something without the advantage of having documentation (cart before the horse thingee). If my experiments don't work, I right-click the file's tab in the editor and choose Local History &amp;gt; Show Local History. I can use the local history to quickly and safely back out my changes and try a different route. I can also use it to highlight the code that I changed (see below) so that I can examine it carefully to make sure I didn't make a mistake.&lt;/p&gt;
&lt;img src="http://blogs.sun.com/divas/resource/history.gif" border=1&gt;

&lt;p&gt;Comparing files is old technology that has been around since UNIX was invented (probably even before that), but NetBeans takes it to the next level. For example, I recently realized that I had accidentally made changes to a duplicate file instead of the one I was currently working on.  Rather than trying to remember what I had done, and then trying to recreate the changes exactly, I simply opened the working document in the editor, right-clicked on the tab, and chose Diff To. I pointed to the older version and got the following output. All I had to do was click the arrows to bring the changes over to the new file.&lt;/p&gt;
&lt;img src="http://blogs.sun.com/divas/resource/comparefiles.gif" border=1&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/LNpHCt81fC8" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/getting_started_with_netbeans_ruby1</id>
        <title type="html">Getting Started With NetBeans Ruby 6.5</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/getting_started_with_netbeans_ruby1" />
        <published>2008-08-15T17:47:53-07:00</published>
        <updated>2008-08-15T17:47:53-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;p&gt;Now that I have most of the online help done for NetBeans Ruby 6.5, I can start updating the tutorials. I have already started getting comments from customers who are discovering that the 6.1 tutorials don't work with 6.5, so I thought I should quickly blog about known differences. The main reasons these tutorials don't work with 6.1 are: (1) Rails upgrade from 2.0.2 to 2.1 and (2) the addition of the GlassFish server. I am still learning about the 6.5 changes and enhancements, so I probably won't get them all listed here. If you find something that I didn't catch, please add a comment.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;a href="http://www.netbeans.org/kb/61/ruby/setting-up.html"&gt;Installing and Configuring Ruby Support&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
The GlassFish V3 Prelude application server is now included with the Ruby bundle. If you are starting from a fresh install, it will be the default server. When you run your Rails apps using the GlassFish server, the URL will be different than if you run with WEBrick or Mongrel. The port is 8080 and you include project name in the URL. (There is an option in the JRuby tab of the server's properties dialog box to Deploy All Rails Applications at Root Context, so if you don't want the project name in the URL you could change that configuration. However, you can have problems if you have more than one Rails application deployed to the server if they have similar routes.). &lt;/p&gt;
&lt;p&gt;
For the information about Using Database Servers With JRuby, I suggest that you go to &lt;a href="http://wiki.netbeans.org/FaqRailsJRubyDatabaseAccess"&gt;wiki.netbeans.org/FaqRailsJRubyDatabaseAccess&lt;/a&gt;. If you are using the generic Active Record JDBC adapter and you select the Access Database Using JDBC checkbox, the IDE puts the appropriate driver in the classpath for you, providing that the database server has been registered with the IDE and the IDE knows the driver's location. If you are running the application with the GlassFish server, and you are using SQLite (or a database server that stores its databases in files), you have to edit the &lt;tt&gt;database.yml&lt;/tt&gt; file to specify the full path to the database, such as&lt;br&gt;&lt;br&gt;
&lt;tt&gt;database: /usr/local/sqlite/var/rubyweblog_development.sqlite&lt;/tt&gt;&lt;br&gt;&lt;br&gt;
Now that GlassFish V3 is included, you can run with GlassFish for your development, test, and production environments. The IDE now uses Warbler instead of Goldspike. If you select the Add Rake Targets to Support App Server Deployment, and you don't have the Warbler gem installed, the New Project wizard forces you to go all the way to the last step, where you can click a button to install Warbler.
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;a href="http://www.netbeans.org/kb/61/ruby/getting-started.html"&gt;Getting Started With Ruby and Rails&lt;/a&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;
With Ruby applications, the concept of a "main" project doesn't apply anymore. If you click the Run Project button in the main toolbar, the IDE runs the current project. To see what the current project is, look in the IDE's title bar. I typically right-click the project's node in the Project window and choose Run project, because that way I don't have to think about which of my open projects is current.&lt;/p&gt;
&lt;p&gt;If you are using Rails 2.1.0 (The Bundled JRuby comes with Rails 2.1.0), you need to edit the Configuration &amp;gt; initializers &amp;gt; new_rails_defaults.rb file. Find the two lines that start with &lt;tt&gt;ActiveRecord::Base&lt;/tt&gt; and comment them out. Supposedly, in the next Rails release, this code will only be executed if active record is defined, but for now, you have to comment out the lines.&lt;/p&gt;
&lt;p&gt;In Step 7 of Create the Model Class, you paste some code into the &lt;tt&gt;item.rb&lt;/tt&gt; file. In that code, replace this line:&lt;/p&gt;
&lt;pre&gt;DATA_FILE="data.yml"&lt;/pre&gt;
&lt;p&gt;with this line:&lt;/pre&gt;
&lt;pre&gt;DATA_FILE = RAILS_ROOT + "/data.yml"&lt;/pre&gt;
&lt;p&gt;The original code won't work when you run in the GlassFish server, because it relied on the server running
in the working directory.&lt;/p&gt;
&lt;p&gt;In Step 8 of of Run the Application (for the Rails project), use the X button that appears in the left side of the server's tab in the Output window. While there is also an X button in the bottom right for the WEBrick server, this button does not appear for the GlassFish server. On the other hand, the X button is in all the server output windows.
&lt;/p&gt;
&lt;p&gt;In Step 9 of Run the Application , there is no longer a "main" project for Ruby projects. So, click the Run Project button if the title bar shows that your Rails application is the current project, or right-click the project's node and choose Run.
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;a href="http://www.netbeans.org/kb/61/ruby/rapid-ruby-weblog.html"&gt;Creating a Ruby Weblog in 10 Minutes&lt;/a&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;In the Creating the Database section, you now choose Run/Debug Rake Task, which opens the Rake Runner. Type &lt;tt&gt;db:c&lt;/tt&gt; in the Filter text box to narrow down the list of tasks. Double-click &lt;tt&gt;db:create&lt;/tt&gt; to run that task.
&lt;/p&gt;
&lt;p&gt;In step 3 of Creating the Database section, you will see that the file name has changed. Instead of using a sequence number prefix (as in &lt;tt&gt;001_create_posts.rb&lt;/tt&gt;), the Rails script used a timestamp prefix (something like &lt;tt&gt;200808152345453_create_posts.rb&lt;/tt&gt;). To learn more about why Rails did this, see &lt;a href="http://brentrubyrails.blogspot.com/2008/06/timestamp-based-migrations-in-rails-21.html"&gt;Brent's blog entry&lt;/a&gt; about timestamp based migrations.&lt;/p&gt;
&lt;p&gt;As mentioned earlier, when you run the Rails application with the GlassFish app server, the URL uses 8080 as the port and includes the project name, such as &lt;tt&gt;http://localhost:8080/rubyweblog/&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;In Step 6 of Adding Another Table Column, the code that is generated for Rails 2.1 looks a little different. You can either copy and paste what is provided in the tutorial, and which still works, or you can duplicate the lines as explained in the step and replace both instances of &lt;tt&gt;:title&lt;/tt&gt; with &lt;tt&gt;:body&lt;/tt&gt;, and replace &lt;tt&gt;text_field&lt;/tt&gt; with &lt;tt&gt;text_area&lt;/tt&gt; as shown below.
&lt;/p&gt;
&lt;pre&gt;
  &amp;lt;p&amp;gt;
    &amp;lt;%= f.label :body %&amp;gt;&amp;lt;br /&amp;gt;
    &amp;lt;%= f.text_area :body %&amp;gt;
  &amp;lt;/p&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Do  the same as above for &lt;tt&gt;new.html.erb&lt;/tt&gt;.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/cZzQg0U8gIM" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/netbeans_ruby_faqs_in_japanese</id>
        <title type="html">NetBeans Ruby FAQs in Japanese</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/netbeans_ruby_faqs_in_japanese" />
        <published>2008-08-06T10:34:32-07:00</published>
        <updated>2008-08-06T10:34:32-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;a href="http://blogs.sun.com/katakai/entry/netbeans_ruby_support_faq"&gt;Masaki Katakai&lt;/a&gt;, who is a software engineer working in the software globalization group, has translated the NetBeans Ruby FAQs into Japanese. Check them out at &lt;a href="http://wiki.netbeans.org/RubyFAQJa"&gt;http://wiki.netbeans.org/RubyFAQJa&lt;/a&gt;. The globalization group's main task is to provide localized NetBeans for Japanese,
Chinese, and Brazilian Portuguese. Masaki is the technical lead of the globalization side
and works on Japanese localization. &lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/zCQY6NR4fbo" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/martin_talks_about_rake_runner</id>
        <title type="html">Martin talks about Rake Runner, Ruby Debugging, and Other 6.5 Enhancements</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/martin_talks_about_rake_runner" />
        <published>2008-07-21T17:55:44-07:00</published>
        <updated>2008-07-21T17:55:44-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;img src="http://blogs.sun.com/divas/resource/martin.jpg" border=1 align="left" vspace="10" hspace="15"&gt;
&lt;p&gt;As I mentioned a couple of weeks ago, I am researching the new Ruby and Rails features in the upcoming NetBeans IDE 6.5. Last week, Martin Krauskopf and I talked about the work that he is doing. Some of you might know Martin from his earlier work with &lt;a href="http://blogs.sun.com/jglick/"&gt;Jesse Glick&lt;/a&gt; on NetBeans Module Development (also known as APISupport) which was great experience for him. Before he joined Sun, Martin says that he "enjoyed a short experience working on the Vim plugin for Eclipse ;)".&lt;/p&gt;

&lt;p&gt;One of his most noticeable pieces of work for 6.5 is the new &lt;a href="http://blogs.sun.com/martink/entry/rake_task_runner"&gt;Rake Runner dialog box&lt;/a&gt;, which I am finding to be a nice improvement. In addition, Martin has also done an overhaul on the Rake infrastructure, and he worked on providing a pre-generated Rakefile for new projects, which includes tasks such as clean, gem, packages, rdoc, spec, and test (Martin: thanks Dudley Flanders for tips).&lt;/p&gt;

&lt;p&gt;On the debugging side, he has released new versions of the fast &lt;a href="http://blogs.sun.com/martink/entry/jruby_fast_debugger_0_10"&gt;JRuby debugger&lt;/a&gt; and &lt;code&gt;ruby-debug-ide&lt;/code&gt; gems, which the 6.5 IDE utilizes to bring support for conditional breakpoints and &lt;i&gt;catchpoints&lt;/i&gt; (breakpoint on exception).&lt;p&gt;

&lt;p&gt;You will also see improvements in the &lt;a href="http://wiki.netbeans.org/RubyGems"&gt;Ruby Gems Manager&lt;/a&gt;. When you open up the manager, you can now easily switch the platform, without having to wait for the manager to finish fetching the data for the currently selected repository. Martin also added the -a (fetch all versions) and -d (fetch detailed gem description) options for tweaking gems fetching so that it goes a bit faster. If the manager finds that it doesn't have permissions on the repository directory for updating and installing gems, it will now invoke the underlying &lt;code&gt;gem&lt;/code&gt; commands using &lt;code&gt;gksu&lt;/code&gt; or &lt;code&gt;kdesu&lt;/code&gt;, as appropriate (if it finds it).&lt;/p&gt;

&lt;p&gt;Two other changes that Martin made were to (1) provide support for Rubinius, an addition to MRI Ruby and JRuby, and (2) Enable you to use the project's Properties dialog box to pass JVM options to JRuby, such as &lt;t&gt;-Djruby.objectspace.enabled=true&lt;/tt&gt;. Martin is also looking for user situations where something might go wrong and is trying to either make sure that the user gets good messages to help resolve the problem, or have the IDE handle the situation better. His goal is to provide good problem detection capabilities and to provide users with more useful help and clues in such situations. He is focusing on the areas where there are multiple interpreters and multiple Gem Home and Gem Path settings, some with root-writable repositories, as well different VMs with different fast debugging support. He has made several enhancements in this area for 6.5 and will continue working on this for 6.5 and in the next release.&lt;/p&gt;

&lt;p&gt;For 6.5, if time permits, he would also like to add support for the Rubinius fast debugger that is being developed by &lt;a href="http://betterruby.wordpress.com/"&gt;Adam Gardiner&lt;/a&gt;, and polish some problems and behaviors of all debuggers generally, since there are still a few remaining issues after the &lt;code&gt;ruby-debug-ide&lt;/code&gt; overhaul.&lt;/p&gt;

&lt;p&gt;I asked Martin what he does when he isn't working so hard. He likes to spend his free time doing sports such as skiing and biking. He usually spends his vacations with his girlfriend and their friends traveling in his own country (Czech Republic), or around the world, often in the mountains with backpacks. His best vacation was the trip to Himachal Pradesh in the north-west of India.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/TtKM5IE1LcE" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/two_new_ruby_tutorials_for</id>
        <title type="html">Two New Ruby Tutorials for NetBeans IDE 6.1</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/two_new_ruby_tutorials_for" />
        <published>2008-07-15T17:41:37-07:00</published>
        <updated>2008-07-15T17:41:37-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;p&gt;I just published two more NetBeans IDE 6.1 tutorials.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.netbeans.org/kb/61/ruby/getting-started.html"&gt;Getting Started With Ruby and Rails&lt;/a&gt; is a quick tutorial that shows off many of the NetBeans features.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.netbeans.org/kb/61/ruby/java-ruby.html"&gt;Using Java Libraries in Rails Applications&lt;/a&gt; shows to use the Java API in Rails applications. In this tutorial, you use the FreeTTS speech synthesis Java libraries to enable users to listen to blog posts. I have fun testing this tutorial and listening to the funny sounding man in my computer read my blogs to me. I got quite a bit of help and advice from &lt;a href="http://www.nabble.com/Need-advice-for-code-in-NetBeans-Rails-JRuby-tutorials-tt18453781.html"&gt;
NetBeans Ruby users&lt;/a&gt; for the final bits of code. Thanks for the help guys! I do appreciate it.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/miSOmYtD6is" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/erno_talks_about_new_rails</id>
        <title type="html">Erno Talks About New Rails Features and Customer Involvement</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/erno_talks_about_new_rails" />
        <published>2008-07-08T09:41:15-07:00</published>
        <updated>2008-07-08T09:41:15-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <category term="test" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;img align="right" border="1" src="http://blogs.sun.com/divas/resource/kuva.JPG"&gt;
&lt;p&gt;One of the software engineers that I get to work with on the NetBeans Ruby project is Erno Mononen, who works in Prague. Erno works mostly on the NetBeans Ruby IDE, but is also involved in some parts of the Java EE support in the NetBeans IDE. I am finally catching up with the documentation for 6.1 and took some time to talk with Erno about the work that he is doing for the upcoming 6.5 release.&lt;/p&gt;


&lt;p&gt;&lt;b&gt;Chris:&lt;/b&gt; The new &lt;a href="http://blogs.sun.com/emononen/entry/new_test_runner_ui"&gt;Test Runner UI&lt;/a&gt; that you recently added to the &lt;a href="http://wiki.netbeans.org/RubyInstallation"&gt;6.5 development version&lt;/a&gt; is awesome. Can you tell us about other cool changes that you are making to the next version of Ruby support?&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Erno:&lt;/b&gt; Thanks! I'll be looking into adding support for &lt;a href="http://wiki.jruby.org/wiki/Warbler"&gt;Warbler&lt;/a&gt;, which offers a more elegant way to create a .war file out of a Rails application than the currently supported GoldSpike plugin. I'd also like to implement a couple of enhancements in the database and server integration areas, such as adding support for additional servers. And last but not least, there is still a lot to do in the test runner -- I've gotten some very good ideas from our users, and would like to address as many of those as possible for 6.5.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Chris:&lt;/b&gt;You mention ideas from users. How do users submit ideas to the NetBeans Ruby engineering team?&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Erno:&lt;/b&gt;There are several different ways to do that. Users can file enhancement requests directly into  our &lt;a href="http://www.netbeans.org/kb/articles/issuezilla.html"&gt;issue tracker&lt;/a&gt; or they can send their ideas to the &lt;a href="mailto:dev@ruby.netbeans.org"&gt;dev@ruby.netbeans.org&lt;/a&gt; or &lt;a href="mailto:users@ruby.netbeans.org"&gt;users@ruby.netbeans.org&lt;/a&gt; mailing lists, where they can be discussed with the community. Furthermore, most of the developers in the Ruby team have blogs that are open for comments. Lastly, we welcome anyone to come to have a chat if you see us around at conferences or anywhere else. Feedback is always appreciated.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Chris:&lt;/b&gt; Can you give examples of user suggestions that you have incorporated into the product?
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Erno:&lt;/b&gt; I think the new test runner serves as a good example both of a user requested new feature and smaller enhancement. It was our users who requested this in the first place, so the test runner as a whole is a user requested feature that has been incorporated into the product. In addition, since its incorporation our users have been active in filing bugs and enhancements for it. For example, the error badges for failing tests in the test tree view of the runner were suggested by a user. &lt;/p&gt;

&lt;p&gt;&lt;b&gt;Chris:&lt;/b&gt; Can you talk about some of the 6.5 features that you think Ruby programmers will look forward to seeing? &lt;/p&gt;


&lt;p&gt;&lt;b&gt;Erno:&lt;/b&gt; Hopefully the new test runner will be one of those features :^) There are quite a few other things as well that I think our users may find of interest, to mention a few of them:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The new Rake task runner, which Martin Krauskopf implemented, makes running rake tasks much more convenient&lt;/li&gt;
&lt;li&gt;Client side JavaScript debugging should be useful to many Rails developers&lt;/li&gt;
&lt;li&gt;The Quick Search feature offers fast access to all the actions registered in the IDE&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In addition there are a lot of improvements in JavaScript, Ruby, and CSS editing, and naturally a bunch of bug fixes in all areas.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Chris:&lt;/b&gt; So what do you do when you are not working on the IDE?&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Erno:&lt;/b&gt; I spend most of my free time with my wife and son, but when I have some time just for myself, I can usually be seen either doing various sports, reading books, or playing the guitar. &lt;/p&gt;

&lt;p&gt;&lt;b&gt;Chris:&lt;/b&gt; Thanks Erno, I look forward to writing about the new NetBeans Ruby features for 6.5.&lt;/p&gt;


&lt;p&gt;&lt;b&gt;Notes:&lt;/b&gt; You can download Milestone 1 (a pre-beta version) of NetBeans IDE 6.5 from &lt;a href="http://www.netbeans.org"&gt;www.netbeans.org&lt;/a&gt;. The &lt;a href="http://www.netbeans.org/kb/trails/ruby.html"&gt;Ruby Trails&lt;/a&gt; web page has links to Erno's blog as well as the other engineers who work on the NetBeans Ruby IDE. The &lt;a href="http://wiki.netbeans.org/Ruby"&gt;NetBeans Ruby Wiki&lt;/a&gt; page has links to the most recent entries of all these blogs. Also, you can view the NetBeans Ruby mailing lists at &lt;a href="http://www.nabble.com/NetBeans-Ruby-f27019.html"&gt;Nabble&lt;/a&gt;.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/78dTSV7q1Ig" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/how_do_i_access_databases</id>
        <title type="html">How Do I Access Databases From My JRuby Rails Project?</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/how_do_i_access_databases" />
        <published>2008-07-07T16:42:53-07:00</published>
        <updated>2008-07-07T16:42:53-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="jruby" scheme="http://roller.apache.org/ns/tags/" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;p&gt;Over the last year, as I wrote and updated the Ruby tutorials, I end up with many different versions of the Rails applications, where each is based on a different version of JRuby. I often test with both Ruby and JRuby, and I try to test them using different database servers. Rather than follow a tutorial from scratch to get a working version for my current configuration, I wanted to learn how to easily take an application and change it to work with a different database configuration. For example, how can I take an application that I developed using the native Ruby interpreter, and make it work using the JRuby interpreter, or take an MySQL application and use it with a PostgreSQL server. As I researched the history of JRuby access to databases, I compiled my notes into a FAQ, which I posted to &lt;a href="http://wiki.netbeans.org/FaqRailsJRubyDatabaseAccess"&gt;wiki.netbeans.org/FaqRailsJRubyDatabaseAccess&lt;/a&gt;.
&lt;/p&gt; 
&lt;p&gt;Hopefully, you will find it helpful. If not, post a comment as to what other information you would like to see, or let me know when the instructions don't work. Even better, you can correct the FAQ itself if you have &lt;a href="http://www.netbeans.org/servlets/Join"&gt;joined the NetBeans community&lt;/a&gt;.
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/wyghbgPhT6c" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/using_the_irb_in_the</id>
        <title type="html">Using the IRB in the NetBeans IDE</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/using_the_irb_in_the" />
        <published>2008-06-20T15:45:48-07:00</published>
        <updated>2008-07-02T10:30:55-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;p&gt;&lt;strong&gt;&lt;span style="color:#804000"&gt;Accessing the IRB Console from the
IDE&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Ruby support in the NetBeans 6.1 IDE includes the Interactive Ruby (IRB)
Console. To open the console, choose &lt;strong&gt;Window &amp;gt; Other &amp;gt; Ruby
Shell&lt;/strong&gt; from the main menu. The console opens in the bottom window.&lt;/p&gt;
&lt;p&gt;&lt;img alt="The IRB console" border="1" src="http://blogs.sun.com/divas/resource/irb.png"
/&gt;&lt;/p&gt;

&lt;p&gt;The interpreter that is used by the console depends on the main project's
&lt;strong&gt;Ruby Platform&lt;/strong&gt; setting (the bold project node in the Projects
window is the main project). To see the Ruby Platform setting, right-click on
project's node and choose &lt;strong&gt;Properties&lt;/strong&gt;. If your project is a
Ruby project, select &lt;strong&gt;Run&lt;/strong&gt; in the &lt;strong&gt;Categories&lt;/strong&gt;
pane to see the Ruby Platform setting. You can switch to a different platform,
if you want.&lt;/p&gt;



&lt;p&gt;The tab for the IRB console window indicates which the interpreter it is
using. In the above screenshot, you can see that the IDE is using the Built-In
JRuby platform.&lt;/p&gt;

&lt;p&gt;To exit from the IRB console, type &lt;strong&gt;exit&lt;/strong&gt; or
&lt;strong&gt;quit&lt;/strong&gt;, and close the window.&lt;/p&gt;

&lt;p&gt;&lt;strong style="color:#804000"&gt;Using Gems in the IRB Console&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before you can use gems in the IRB, you have to load RubyGems. Most
platforms take care of this for you. For those that do not, such as the
built-in JRuby platform, you must load it yourself. If you do not load
RubyGems, you will see an error similar to the following output.&lt;/p&gt;
&lt;pre&gt;&lt;span style="color:#008080"&gt;&lt;span style="color:#008000"&gt;&amp;gt;&amp;gt; require 'renum'
  LoadError: no such file to load -- renum
  from (irb):2:in `require'
  from (irb):2:in `signal_status'&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;The quickest way load RubyGems is to type the following statement in the
console.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;span style="color:#008040"&gt;&lt;span style="color:#008000"&gt;&amp;gt;&amp;gt;
require 'rubygems'&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you do not want to type that every time you open an IRB console, you can
add &lt;code&gt;-rubygems&lt;/code&gt; to the &lt;strong&gt;Ruby Options&lt;/strong&gt; text box in the
project's &lt;strong&gt;Properties&lt;/strong&gt; dialog box. &lt;/p&gt;

&lt;p&gt;&lt;img alt="Setting -rubygems in the Properties dialog box" border="1"
src="http://blogs.sun.com/divas/resource/properties.png" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong style="color:#804000"&gt;Using &lt;code&gt;.irbrc&lt;/code&gt; Files for Common
Settings&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Another way to load RubyGems every time you open the console, is to add or
copy over an &lt;code&gt;.irbrc&lt;/code&gt; file to the project's top level folder and add
&lt;code&gt;require 'rubygems'&lt;/code&gt; to that file. To create an &lt;code&gt;.irbrc&lt;/code&gt;
file, right-click the &lt;strong&gt;project&lt;/strong&gt; node and choose &lt;strong&gt;New &amp;gt;
Other&lt;/strong&gt; from the pop-up menu. Select &lt;strong&gt;Other&lt;/strong&gt; in the
&lt;strong&gt;Categories&lt;/strong&gt; pane, select &lt;strong&gt;Empty File&lt;/strong&gt; in the
&lt;strong&gt;File Types&lt;/strong&gt; pane, and click &lt;strong&gt;Next&lt;/strong&gt;. Name the
file &lt;code&gt;.irbrc&lt;/code&gt; and click &lt;strong&gt;Finish&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;If you have IRB settings that you would like applied to all your projects,
such as loading RubyGems, you can put the settings in an &lt;code&gt;.irbrc&lt;/code&gt;
file in your home directory. In order to get the IDE to read this file when
opening the IRB console, you must create a &lt;code&gt;HOME&lt;/code&gt; system environment
variable (be sure to make it all capital letters) that provides the path to
your home directory, and restart the IDE.&lt;/p&gt;

&lt;p&gt;Note that you will not see the &lt;code&gt;.irbrc&lt;/code&gt; file in the Projects
window or the Files window. To learn how to configure the IDE so that you can
see this file, see MRHAKI's &lt;a
href="http://mrhaki.blogspot.com/2008/06/display-hidden-dot-files-and.html"&gt;blog&lt;/a&gt;
that shows how.&lt;/p&gt;

&lt;p&gt;&lt;strong style="color:#804000"&gt;Using the JRuby IRB Console&lt;/strong&gt;&lt;span
style="color:#804000"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;The IDE also offers support for the JRuby IRB console. With this console,
you get code completion, as shown below. You can type the first few characters
and press &lt;strong&gt;Tab&lt;/strong&gt; to see a list of suggestions.&lt;/p&gt;

&lt;p&gt;&lt;img alt="JRuby IRB console" border="1"
src="http://blogs.sun.com/divas/resource/irbcodepopup.png" /&gt;&lt;/p&gt;

&lt;p&gt;The JRuby IRB console also has a history feature. Pressing the
&lt;strong&gt;Up-Arrow&lt;/strong&gt; key scrolls through through the command history and
pressing the &lt;strong&gt;Down-Arrow&lt;/strong&gt; key scrolls back. You can press Return
to re-execute a command.&lt;/p&gt;

&lt;p&gt;To enable the JRuby IRB console, add the following flag to your NetBeans IDE
startup command or add it to the &lt;code&gt;netbeans_default_options&lt;/code&gt; entry in
the &lt;em&gt;netbeans-install-dir&lt;/em&gt;&lt;code&gt;/etc/netbeans.conf&lt;/code&gt; file, and
restart the IDE. One problem with this option, is that you get the JRuby IRB
console, regardless of which platform your project is using.&lt;/p&gt;
&lt;pre&gt;
-J-Dirb.jruby=true
&lt;/pre&gt;
&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/z72xfvZfQoM" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/my_rails_learning_path_flash</id>
        <title type="html">My Rails Learning Path: Flash Pitfalls</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/my_rails_learning_path_flash" />
        <published>2008-06-10T10:30:05-07:00</published>
        <updated>2008-06-10T10:30:05-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="flash" scheme="http://roller.apache.org/ns/tags/" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;img src="http://blogs.sun.com/divas/resource/makalawenamaze.jpg" border="1" alt="Makalawena Maize" title="Makalawena Maize"&gt;
&lt;p&gt;&lt;p&gt;For the past few weeks, I have been working on writing the NetBeans IDE 6.1/Rails 2.0 version of the &lt;a href="http://www.netbeans.org/kb/61/ruby/model.html"&gt;Building Relationships Between Models&lt;/a&gt; tutorial. The &lt;a href="http://wiki.netbeans.org/Ruby"&gt;NetBeans Ruby community&lt;/a&gt; provided helpful guidance, especially Florian Gilcher, who spent a lot of time shaping up the code and teaching me about best practices. Florian moderates the Rails part of &lt;a href="http://www.rubyforen.de "&gt;Rubyforen&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The first input I got from Florian was actually about the Rails 1.2 version of the &lt;a href="http://www.netbeans.org/kb/60/ruby/model.html"&gt;tutorial&lt;/a&gt;. In this tutorial, they used the flash to pass the post's id from the show action to the show template and from the show template to post_comment action.&lt;/p&gt;

&lt;p&gt;Florian pointed out that using the flash to store state information can cause two severe bugs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;b&gt;Session Time Out Bug.&lt;/b&gt; A session is volatile and thus gets erased after a certain amount of time, typically 15 minutes after the last client request. Should a user get a phone call in the middle of writing a comment, the session could be invalidated, creating a new one. When the user submits the comment, the flash is empty and he gets a 500 status. Not good!.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;Multiple Request Bug.&lt;/b&gt; The flash holds for one &lt;i&gt;unspecified request&lt;/i&gt;. If the browser fires off another request, the flash is emptied. Thus a user switching between writing a comment and reading posts on other message boards runs into the same problem as above.&lt;/b&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I have the feeling that several of the lab participants at our &lt;a href="http://developers.sun.com/learning/javaoneonline/j1lab.jsp?lab=LAB-8400&amp;yr=2008&amp;track=1"&gt;JavaOne hands-on-lab&lt;/a&gt; ran into these exact problems, as they were using the same browser to read the lab steps and run the application. I had not run into these  problems when testing the lab or the original tutorial. As Florian pointed out, "The bad thing about both bugs is that they almost never appear in testing environments. I would never sit before my PC writing plain text for 15 minutes, and explain my boss that I was testing ;)."&lt;/p&gt;

&lt;p&gt;Instead of using the flash, you can simply add the the id in the call to &lt;tt&gt;form_tag&lt;/tt&gt; (&lt;tt&gt;form_tag :action  =&gt; 'post_comment', :id =&gt; @post&lt;/tt&gt;). This maps to &lt;tt&gt;/blog/post_comment/&lt;/tt&gt;&lt;i&gt;id&lt;/i&gt;, which matches the pattern declared by the &lt;tt&gt; map.connect ':controller/:action/:id'&lt;/tt&gt; mapping in &lt;tt&gt;routes.rb&lt;/tt&gt;. An alternative is to pass it in a hidden field. One problem with these solutions is that the data can be tampered with, so you need to make your application able to cope with that. As Florian said, "If the user wants to play madman, he should only be able do this with data he actually is allowed to edit."&lt;/p&gt;

&lt;p&gt;So, lesson learned! Fortunately, the NetBeans Ruby 6.1 tutorials use RESTful resources, and thus eliminate this bad practice altogether. &lt;/p&gt; &lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/nzNO-7on1Yw" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/restful_rails_tutorial</id>
        <title type="html">Rails RESTful Resources Tutorial</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/restful_rails_tutorial" />
        <published>2008-06-06T14:59:37-07:00</published>
        <updated>2008-06-06T14:59:37-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rest" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;p&gt;Today, we published an updated version of the &lt;a href="http://www.netbeans.org/kb/61/ruby/model.html"&gt;Building a Relationship Between Two Models&lt;/a&gt; tutorial. This update takes the RESTful approach to working with &lt;tt&gt;has_many&lt;/tt&gt; relationships, in this case the relationship between a post (the parent) and its comments (the children). REST, which is an acronym for representational state transfer, is an architecture style for hypermedia, such as web applications. By using this architecture, you end up with a simple, uniform way to set up routing for your create-read-update-delete (CRUD) applications, which typically perform the following actions for a resource:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;List (Index)&lt;/li&gt;
&lt;li&gt;Create&lt;/li&gt;
&lt;li&gt;New&lt;/li&gt;
&lt;li&gt;Show&lt;/li&gt;
&lt;li&gt;Edit&lt;/li&gt;
&lt;li&gt;Update&lt;/li&gt;
&lt;li&gt;Destroy&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With RESTful routing, you can use a combination  of four HTTP methods (GET, POST, PUT, and DELETE) and four patterns (&lt;tt&gt;/&lt;i&gt;controller-name&lt;/i&gt;&lt;/tt&gt;,  &lt;tt&gt;/&lt;i&gt;controller-name&lt;/i&gt;/:id&lt;/tt&gt;, &lt;tt&gt;/&lt;i&gt;controller-name&lt;/i&gt;/:id/edit&lt;/tt&gt;, and &lt;tt&gt;/&lt;i&gt;controller-name&lt;/i&gt;/new&lt;/tt&gt;) to formulate the URLs that map to the above actions. For example, for the post resource, you can use the following URLs and HTTP methods:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;b&gt;List.&lt;/b&gt; &lt;tt&gt;/posts&lt;/tt&gt; + GET&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Create.&lt;/b&gt; &lt;tt&gt;/posts&lt;/tt&gt; + POST&lt;/li&gt;
&lt;li&gt;&lt;b&gt;New.&lt;/b&gt; &lt;tt&gt;/posts/new&lt;/tt&gt; + GET&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Show.&lt;/b&gt; &lt;tt&gt;/posts/:id&lt;/tt&gt; + GET&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Edit.&lt;/b&gt; &lt;tt&gt;/posts/:id/edit&lt;/tt&gt; + GET&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Update.&lt;/b&gt; &lt;tt&gt;/posts/:id/&lt;/tt&gt; + PUT&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Destroy.&lt;/b&gt; &lt;tt&gt;/posts/:id&lt;/tt&gt; + DELETE&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Rails support for RESTful routing makes this all very easy. When you add a resource to your Rails application, the framework automatically adds to the &lt;tt&gt;routes.rb&lt;/tt&gt; file a &lt;tt&gt;map.resource&lt;/tt&gt; method call  that generates the appropriate route mappings to the seven actions, and also creates numerous helper methods for generating paths and urls in string and hash format. Basically, all you have to remember are four substrings:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;collection&lt;/i&gt;, such as &lt;tt&gt;posts&lt;/tt&gt;, for list (index) and create&lt;/li&gt;
&lt;li&gt;&lt;i&gt;object&lt;/i&gt;, such as &lt;tt&gt;post&lt;/tt&gt;, for show, edit, and destroy&lt;/li&gt;
&lt;li&gt;&lt;tt&gt;new_&lt;/tt&gt;&lt;i&gt;object&lt;/i&gt;, such as &lt;tt&gt;new_post&lt;/tt&gt;, for new&lt;/li&gt;
&lt;li&gt;&lt;tt&gt;edit_&lt;/tt&gt;&lt;i&gt;object&lt;/i&gt;, such as &lt;tt&gt;edit_post&lt;/tt&gt;, for edit&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For example, to generate the path to invoke the create action, you use &lt;tt&gt;new_post_path&lt;/tt&gt;.
To generate the path to invoke the edit action, you use &lt;tt&gt;edit_post_path(:id)&lt;/tt&gt;.
&lt;/p&gt;
&lt;p&gt;In the scenario in the tutorial, where there is a parent-child relationship, you use the Rails nested resources support, which ensures that the comment resources are always accessed in relationship to a post. For example, to generate the path to the create action for comments, you use &lt;tt&gt;post_comments_path(:post_id)&lt;/tt&gt;, which generates
the URL &lt;tt&gt;/posts/:post_id/comments&lt;/tt&gt;.
&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://www.netbeans.org/kb/61/ruby/model.html"&gt;tutorial&lt;/a&gt; is a nice way to quickly see RESTful routing in action. If you are interested in learning more about this topic, the tutorial lists several resources that provide in depth explanations of REST architecture and Rails support for this methodology.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; I should point out that REST architecture is not simply about URLs and routing. It is a set of constraints that "when applied as a whole, emphasizes scalability of component interactions, generality of interfaces, independent deployment of components, and intermediary components to reduce interaction latency, enforce security, and encapsulate legacy systems." [Roy Fielding, Architectural Styles and
the Design of Network-based Software Architectures, &lt;a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm"&gt;Chapter 5&lt;/a&gt;, 2000].&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/OC5FTXofBEk" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/see_you_at_javaone_2008</id>
        <title type="html">See You at JavaOne 2008</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/see_you_at_javaone_2008" />
        <published>2008-04-08T11:59:44-07:00</published>
        <updated>2008-04-29T05:36:11-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="ajax" scheme="http://roller.apache.org/ns/tags/" />
        <category term="dynamicfaces" scheme="http://roller.apache.org/ns/tags/" />
        <category term="javaone" scheme="http://roller.apache.org/ns/tags/" />
        <category term="javaone2008" scheme="http://roller.apache.org/ns/tags/" />
        <category term="jsf" scheme="http://roller.apache.org/ns/tags/" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <category term="vwp" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;img src="http://blogs.sun.com/divas/resource/volcano036.jpg" border="1"&gt;
&lt;p&gt;This year, &lt;a href="http://weblogs.java.net/blog/bleonard/"&gt;Brian Leonard&lt;/a&gt;, and I (diva #2) are putting on the &lt;a href="https://www28.cplan.com/cc191/sessions_catalog.jsp?ilc=191-1&amp;ilg=english&amp;isort=&amp;isort_type=&amp;is=yes&amp;icriteria1=27615&amp;icriteria2=+&amp;icriteria9=&amp;icriteria8=&amp;icriteria3=Kutler"&gt;	Developing (J)Ruby on Rails Applications with the NetBeans™ IDE&lt;/a&gt; hands-on lab at JavaOne. If you haven't tried developing a web application using Ruby on Rails, this is a good opportunity to get your feet wet. For those of you who are familiar with Ruby but haven't tried it in the IDE, you will also find this lab helpful. In this lab, you build the classic Ruby web log, you access the FreeTTS Java API to speach-enable the application, and you deploy the application to the GlassFish application server.&lt;/p&gt;
&lt;p&gt;Speaking of JavaOne, in last year's hands-on-lab, one of the exercises was to use Dynamic Faces to build a chat room application. This section has been turned into the &lt;a href="http://www.netbeans.org/kb/60/web/ajaxchatroom.html"&gt;Building an Ajax Chat Room with the Ajax Transaction Dynamic Faces Component&lt;/a&gt; tutorial which is available from the NetBeans 
&lt;a href="http://www.netbeans.org/kb/trails/web.html"&gt;Web Application Learning Trail&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;About the picture. Right behind me is flowing lava. To be able to walk right up to 1200 degree Celsius lava flow was an awesome experience. Fortunately, because the lava contains a large amount of glass, the lava flows very slowly.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/ro26If2-GgY" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/new_ruby_developer_resource_center</id>
        <title type="html">New Ruby Developer Resource Center</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/new_ruby_developer_resource_center" />
        <published>2008-03-26T16:52:29-07:00</published>
        <updated>2008-03-26T16:52:29-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;img src="http://www.sun.com/images/l2/l2_ruby.gif" align="left"&gt;
&lt;p&gt;The &lt;a href="http://developers.sun.com/ruby/ "&gt;Ruby Developer Resource Center&lt;/a&gt; at &lt;a href="http://developers.sun.com"&gt;developers.sun.com&lt;/a&gt; is live. Just learning or already deploying? Get downloads, docs, news feeds, blogs, screencasts, and learning trails to help you build applications using Ruby, JRuby, and Ruby-on-Rails.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/Ne9qIUjLxuo" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/netbeans_ide_6_1_beta</id>
        <title type="html">NetBeans IDE 6.1 Beta Blogging Contest</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/netbeans_ide_6_1_beta" />
        <published>2008-03-17T17:17:42-07:00</published>
        <updated>2008-03-17T17:18:23-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="nebeans" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;p&gt;I know that many of you NetBeans Ruby users blog about your experiences. Here's a chance to win a $500 gift certificate or a NetBeans T-Shirt. If you have blogged about your NetBeans 6.1 IDE experience,  all you have to do is go to this &lt;a href="http://www.netbeans.org/competition/blog-contest.html"&gt;Blog Contest&lt;/a&gt; page and submit the URL to your blog. Do it before April 18, 2008.
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/7icBFL8-wgg" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/netbeans_6_1_draft_creating</id>
        <title type="html">NetBeans 6.1 Draft: Creating a Rails 2.0 Weblog in 10 Minutes</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/netbeans_6_1_draft_creating" />
        <published>2008-02-29T13:41:20-08:00</published>
        <updated>2008-04-07T11:03:52-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;p&gt;&lt;i&gt;&lt;b&gt;April 8, 2008 Update:&lt;/b&gt; The final version of this tutorial is available at &lt;a href="http://www.netbeans.org/kb/61/ruby/rapid-ruby-weblog.html"&gt;http://www.netbeans.org/kb/61/ruby/rapid-ruby-weblog.html&lt;/a&gt;.
&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;This is an early draft of a NetBeans IDE 6.1 tutorial 
in which you use the Ruby support in the NetBeans IDE to 
create and run a simple Rails 2.0 web application. 
This tutorial is an update of an earlier &lt;a href="http://blogs.sun.com/divas/entry/creating_a_rails_2_0 "
				 &gt;blog&lt;/a&gt;, which was written for NetBeans IDE 6.0.
				 A final version of this tutorial will be published
				 at &lt;a href="http://www.netbeans.org"&gt;www.netbeans.org&lt;/a&gt;
				 when final NetBeans IDE 6.1 is released.
      &lt;/p&gt;
			
			      &lt;a name="01"&gt;&lt;/a&gt;
      &lt;h2&gt;Tutorial Requirements&lt;/h2&gt;
      &lt;p&gt;This tutorial requires the following technologies and resources. &lt;/p&gt;
      &lt;ul&gt;

         &lt;li&gt;&lt;a href="http://dev.mysql.com/downloads/"&gt;MySQL database server&lt;/a&gt;.&lt;/li&gt;
         &lt;li&gt;NetBeans IDE 6.1 development build with Ruby support. A
beta release is available from &lt;a href="http://www.netbeans.org/community/releases/61/"&gt;here&lt;/a&gt;.&lt;/li&gt;
      &lt;/ul&gt;


 &lt;h2&gt;Creating the Ruby on Rails Project &lt;/h2&gt;
 &lt;p&gt;You begin by creating a Ruby on Rails project.  
 By default, the application 
 is created in a directory structure that conforms to 
 the Ruby on Rails project conventions for applications.
 &lt;/p&gt;
 &lt;ol&gt;
 
 &lt;li&gt;In the NetBeans IDE, choose File &amp;gt; 
 New Project. &lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
  &lt;li&gt;Select Ruby from the Categories list and Ruby on Rails Application from 
	the Projects list. Click Next.
&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
  &lt;li&gt;
    Type &lt;code&gt;rubyweblog&lt;/code&gt; in the Project Name text box.
Accept all the other default settings on this page.   
&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
  &lt;li&gt;Click Next.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
	&lt;li&gt;Select Specify Database Information Directly.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
	&lt;li&gt;Leave the Database Name text box blank, the IDE
	will create default development, test, and 
	production database names based on the project name.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
	&lt;li&gt;Type &lt;tt&gt;root&lt;/tt&gt; in the User Name text box.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
	&lt;li&gt;If the root user requires a password, type the password
	in the Password text box.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
	&lt;li&gt;Click Finish to create the new project.
	
	&lt;p&gt;The IDE creates the project directory with the same name as your project
	and opens the &lt;tt&gt;database.yml&lt;/tt&gt; file in the editing area. Notice that the default
	database name for the development configuration is 
	&lt;tt&gt;rubyweblog_development&lt;/tt&gt;.&lt;/p&gt;
	&lt;/li&gt;
	&lt;li&gt;Click the small &lt;tt&gt;x&lt;/tt&gt; button in the database.yml tab to close
	the file.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
	&lt;ul&gt;
   &lt;/li&gt;
	

&lt;/ol&gt;

&lt;a name="05"&gt;&lt;/a&gt;
&lt;h2&gt;Creating the Scaffold&lt;/h2&gt;
&lt;p&gt;This weblog application is built around the Post
model, which stores instances of blog posts.
Here you use the Rails scaffold generator to create the 
model and its controller, as well as the index (list),
show, new, and edit views.&lt;/p&gt;
&lt;p&gt;The generator also creates
a migration file for creating the model's database table,
and creates unit test and fixture stubs for
writing model tests. Last, the generator
adds the &lt;tt&gt;map.resources :posts&lt;/tt&gt; declaration to
the routes.rb file to create named routes
that are mapped to the URL paths for the controller
actions.&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;p&gt;In the  Projects  window, right-click the rubyweblog project node and 
	choose Generate.&lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;In the Rails Generator dialog box, select scaffold from the Generate 
		drop-down list. Make sure that you select scaffold, and not use the default selected value (controller).&lt;/p&gt;
     &lt;/li&gt;
     &lt;li&gt;
     Type &lt;code&gt;Post&lt;/code&gt; in the Model Name text box.
		 &lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
		 &lt;li&gt;Type &lt;code&gt;title:string&lt;/code&gt; in the Attribute Pairs text
		 box, as shown in the following figure,
		 and click 
		 OK.
   &lt;br&gt;&lt;br&gt;&lt;img src="http://blogs.sun.com/divas/resource/genscaffold.png"&gt;
   &lt;p&gt;The Output window lists the files that 
	 the scaffold generator creates and updates.&lt;/p&gt;
   &lt;/li&gt;
&lt;/ol&gt;
  
	&lt;a name="06"&gt;&lt;/a&gt;
 &lt;h2&gt;Creating the Database &lt;/h2&gt;
 &lt;p&gt;In this section, you use a Rake task to create the rubyweblog_development
 database. Then you use the &lt;code&gt;001_create_posts.rb&lt;/code&gt; migration file
 to add the Posts table to the database. 
 &lt;p&gt;
 &lt;ol&gt;
	&lt;li&gt;In the Projects window, right-click the rubyweblog project node, and choose 
	Run Rake Task &gt; db &gt; create.&lt;/p&gt;
  &lt;p&gt;Rake creates the MySQL database for the development configuration
	in the &lt;tt&gt;database.yml&lt;/tt&gt; file.&lt;/p&gt;
	&lt;/li&gt;
  &lt;li&gt;In the Projects window, expand Database
	Migrations and expand migrate.&lt;br /&gt;
  &lt;br /&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;p&gt;Double-click the 001_create_posts.rb node
	to open the file in the editing area.&lt;/p&gt;
    &lt;p&gt;The file opens to show the &lt;code&gt;self.up&lt;/code&gt; method, which creates a table called posts, and the
    &lt;code&gt;self.down&lt;/code&gt; method, which tears the posts table down, as shown in the following code sample.&lt;/p&gt;

	 &lt;table border="1" bordercolor="#e7e7e7" cellpadding="2" cellspacing="0" class="examplecode"&gt;
      &lt;tr class="bg-white"&gt;
        &lt;td&gt;&lt;b&gt;Code Sample 1: Code for &lt;/b&gt;&lt;strong&gt;&lt;code&gt;001_create_posts.rb&lt;/code&gt;&lt;/strong&gt; &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;pre&gt;
class &lt;i&gt;CreatePosts &amp;lt; ActiveRecord::Migration&lt;/i&gt;
  def self.up
    create_table :posts do |t|
      t.string :title

      t.timestamps
    end
  end

  def self.down
    drop_table :posts
  end
end&lt;/pre&gt;
&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt; 
	&lt;br&gt;
	Note that the &lt;tt&gt;create_table&lt;/tt&gt; method adds an &lt;tt&gt;id&lt;/tt&gt; 
	column by default, and that the
	&lt;tt&gt;timestamps&lt;/tt&gt; method adds the &lt;tt&gt;created_at&lt;/tt&gt; and &lt;tt&gt;updated_at&lt;/tt&gt;
	columns to the database table.
  &lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;In the Projects window, right-click the rubyweblog node and choose Migrate Database &amp;gt; To Current Version.&lt;/p&gt;
    &lt;p&gt;This action updates the the database to include the posts table. The Output window indicates when the migration is complete. &lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;
  &lt;a name="07a"&gt;&lt;/a&gt;
&lt;h2&gt;Running the Application&lt;/h2&gt;
&lt;div&gt;Now test the application.&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
    &lt;p&gt;In the Projects window, expand the Configuration node and double-click &lt;code&gt;routes.rb&lt;/code&gt; to open it in the editor.  Find the comment:&lt;/p&gt;
	&lt;pre&gt;# map.root :controller =&amp;gt; "welcome"
	&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Add the following line under the comment.
	&lt;pre&gt;map.root :controller =&amp;gt; "posts"
	&lt;/pre&gt;
&lt;li&gt;
    &lt;p&gt;In the Projects window, expand the Public node, right-click index.html and choose Delete.&lt;/p&gt;
    &lt;p&gt;The &lt;code&gt;index.html&lt;/code&gt; page displays a 
		default Welcome page, which is not what you want. 
		By deleting &lt;code&gt; index.html&lt;/code&gt;, Rails looks 
		in &lt;code&gt;routes.rb&lt;/code&gt; to figure out what page 
		to display.&lt;/p&gt;
&lt;/li&gt;
  &lt;li&gt;Choose File &gt; Save All from the main menu.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Click the Run Main Project button in the toolbar.&lt;/p&gt;
	&lt;p&gt;This action starts the WEBrick server, which is part of the Ruby on Rails framework, and launches the web browser.&lt;/p&gt;
&lt;p&gt;If you are using a server other than WEBrick, you might need to enter
&lt;code&gt;http://localhost:3000&lt;/code&gt; in the browser's address text box and press Enter.&lt;/p&gt;
  &lt;/li&gt;
	&lt;li&gt;
	  &lt;p&gt;Click the New post link to display the second page of the application.&lt;/p&gt;
  &lt;/li&gt;
		&lt;li&gt;
		  &lt;p&gt;Enter a title and click Create.&lt;/p&gt;
		&lt;/li&gt;
		&lt;li&gt;&lt;p&gt;Click the Back link to return to the list of posts.&lt;/p&gt;
		&lt;/li&gt;

  
&lt;/ol&gt;
&lt;a name="08"&gt;&lt;/a&gt;

&lt;h2&gt; Doing More: Adding Another Table Column &lt;/h2&gt;
&lt;p&gt;Here you add a body column to posts table
to hold the text for each blog entry.&lt;/p&gt;
  &lt;ol&gt;
    &lt;li&gt;
      &lt;p&gt;Right-click the Database Migrations node and choose Generate. 
			In the Rails Generator dialog box, type 
			&lt;code&gt;AddBodyToPost body:text&lt;/code&gt; in the Arguments text box and 
			click OK.&lt;/p&gt;
	  &lt;p&gt;The IDE creates the versioned migration script 
		&lt;code&gt;002_add_body_to_post.rb&lt;/code&gt;. The file opens to show 
		the &lt;code&gt;self.up&lt;/code&gt; method, which adds a body column, and the
    &lt;code&gt;self.down&lt;/code&gt; method, which removes the column, as shown in the 
		following code sample. Notice how the generated code extracted the table
		name from
		the first argument &lt;tt&gt;AddBodyToPost&lt;/tt&gt;.&lt;/p&gt;

	 &lt;table border="1" bordercolor="#e7e7e7" cellpadding="2" cellspacing="0" class="examplecode"&gt;
      &lt;tr class="bg-white"&gt;
        &lt;td&gt;&lt;b&gt;Code Sample 2: Code for &lt;/b&gt;&lt;strong&gt;&lt;code&gt;002_add_body_to_post.rb&lt;/code&gt;&lt;/strong&gt; &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;pre&gt;
class AddBodyToPost &amp;lt; ActiveRecord::Migration
  def self.up
    add_column :posts, :body, :text
  end

  def self.down
    remove_column :posts, :body
  end
end&lt;/pre&gt;
&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt; 
	&lt;br&gt;
    &lt;li&gt;
        &lt;p&gt;Right-click the rubyweblog node and choose Migrate Database &amp;gt; To Current Version.&lt;/p&gt;
        Alternatively, right-click in the source file and choose Run File from the pop-up menu.
    &lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;

 &lt;li&gt;In the Projects window, expand Views and expand 
 posts.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
 &lt;li&gt;Double-click edit.html.erb to open the file in the 
 editing area.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
 &lt;li&gt;&lt;p&gt;Add the statements shown in bold in the following
 code sample.&lt;/p&gt;
  &lt;p&gt;Alternatively, place the cursor before the
 &amp;lt;p&amp;gt; tag for the Title and drag the mouse
 to the position after the paragraph's ending &amp;lt;/p&amp;gt; 
 tag, then press Ctrl+Shift+Down Arrow to duplicate
 the lines. Replace &lt;tt&gt;Title&lt;/tt&gt; with &lt;tt&gt;Body&lt;/tt&gt;
 and replace &lt;tt&gt;f.text_field :title&lt;/tt&gt; with &lt;tt&gt;f.text_area :body&lt;/tt&gt;.
 &lt;/p&gt;
 	 &lt;table border="1" bordercolor="#e7e7e7" cellpadding="2" cellspacing="0" class="examplecode"&gt;
      &lt;tr class="bg-white"&gt;
        &lt;td&gt;&lt;b&gt;Code Sample 3: Adding the Body to the Edit View&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;pre&gt;&amp;lt;h1&amp;gt;Editing post&amp;lt;/h1&amp;gt;

&amp;lt;%= error_messages_for :post %&amp;gt;

&amp;lt;% form_for(@post) do |f| %&amp;gt;
  &amp;lt;p&amp;gt;
    &amp;lt;b&amp;gt;Title&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;
    &amp;lt;%= f.text_field :title %&amp;gt;
  &amp;lt;/p&amp;gt;

  &lt;b&gt;&amp;lt;p&amp;gt;
    &amp;lt;b&amp;gt;Body&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;
    &amp;lt;%= f.text_area :body %&amp;gt;
  &amp;lt;/p&amp;gt;&lt;/b&gt;

  &amp;lt;p&amp;gt;
    &amp;lt;%= f.submit "Update" %&amp;gt;
  &amp;lt;/p&amp;gt;
&amp;lt;% end %&amp;gt;

&amp;lt;%= link_to 'Show', @post %&amp;gt; |
&amp;lt;%= link_to 'Back', posts_path %&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt; 
	&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;


	
&lt;li&gt;Double-click new.html.erb to open the file in the 
editing area.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
 &lt;li&gt;&lt;p&gt;Add the statements shown in bold in the following
 code sample. Alternatively, use Ctrl+Shift+Down Arrow
 to duplicate the Title paragraph and edit the
 duplicated code as described in Step 5.&lt;/p&gt;
 	 &lt;table border="1" bordercolor="#e7e7e7" cellpadding="2" cellspacing="0" class="examplecode"&gt;
      &lt;tr class="bg-white"&gt;
        &lt;td&gt;&lt;b&gt;Code Sample 4: Adding the Body to the New View&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;pre&gt;&amp;lt;h1&amp;gt;New post&amp;lt;/h1&amp;gt;

&amp;lt;%= error_messages_for :post %&amp;gt;

&amp;lt;% form_for(@post) do |f| %&amp;gt;
  &amp;lt;p&amp;gt;
    &amp;lt;b&amp;gt;Title&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;
    &amp;lt;%= f.text_field :title %&amp;gt;
  &amp;lt;/p&amp;gt;

  &lt;b&gt;&amp;lt;p&amp;gt;
    &amp;lt;b&amp;gt;Body&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;
    &amp;lt;%= f.text_area :body %&amp;gt;
  &amp;lt;/p&amp;gt;&lt;/b&gt;
	
  &amp;lt;p&amp;gt;
    &amp;lt;%= f.submit "Create" %&amp;gt;
  &amp;lt;/p&amp;gt;
&amp;lt;% end %&amp;gt;

&amp;lt;%= link_to 'Back', posts_path %&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt; 
	&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;

	

&lt;li&gt;Double-click show.html.erb to open the file in the 
editing area.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
 &lt;li&gt;&lt;p&gt;Add the statements shown in bold in the following code sample.
 Alternatively, use Ctrl+Shift+Down Arrow
 to duplicate the Title paragraph as described in Step 5,
 change &lt;tt&gt;Title:&lt;/tt&gt; to &lt;tt&gt;Body:&lt;/tt&gt;, 
 and change &lt;tt&gt;@post.title&lt;/tt&gt; to &lt;tt&gt;@post.body&lt;/tt&gt;.&lt;/p&gt;

 	 &lt;table border="1" bordercolor="#e7e7e7" cellpadding="2" cellspacing="0" class="examplecode"&gt;
      &lt;tr class="bg-white"&gt;
        &lt;td&gt;&lt;b&gt;Code Sample 5: Adding the Body to the Show View&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;pre&gt;&amp;lt;p&amp;gt;
  &amp;lt;b&amp;gt;Title:&amp;lt;/b&amp;gt;
  &amp;lt;%=h @post.title %&amp;gt;
&amp;lt;/p&amp;gt;

&lt;b&gt;&amp;lt;p&amp;gt;
  &amp;lt;b&amp;gt;Body:&amp;lt;/b&amp;gt;
  &amp;lt;%=h @post.body %&amp;gt;
&amp;lt;/p&amp;gt;&lt;/b&gt;

&amp;lt;%= link_to 'Edit', edit_post_path(@post) %&amp;gt; |
&amp;lt;%= link_to 'Back', posts_path %&amp;gt;&lt;/pre&gt;
&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt; 
	&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;


			&lt;li&gt;Choose File &amp;gt; Save All.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;

  &lt;li&gt;&lt;p&gt;Return to the browser and click the New Post link to see how Ruby recognizes the new body column. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a few more blog entries.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;a name="09a"&gt;&lt;/a&gt;

&lt;h2&gt;Doing More: Validating Input&lt;/h2&gt;
&lt;a name="09"&gt;&lt;/a&gt;
&lt;p&gt;
Here, you add code to the Post class to ensure that the users provide values
for both the title and the body fields.
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In the Projects window, expand the Models node and double-click post.rb
to open the file in the editor.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open up a line inside the Class definition, type &lt;tt&gt;vp&lt;/tt&gt;,
then press Tab.&lt;/p&gt;
The IDE replaces the &lt;tt&gt;vp&lt;/tt&gt; trigger with the following code template.
&lt;pre&gt;validates_presence_of :attribute&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Type &lt;tt&gt;title, :body&lt;/tt&gt;. The code should look like the
following statement.
&lt;pre&gt;validates_presence_of :title, :body&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run the application, click New Post, and click Create.&lt;/p&gt;
The application now reports that the title and body cannot be blank.
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Doing More: Making the List Look More Like a Blog&lt;/h2&gt;
&lt;ol&gt;

  &lt;li&gt;
    &lt;p&gt;Expand Views &gt; posts and open &lt;code&gt;index.html.erb,&lt;/code&gt; which is used to show the list of blog entries.  Delete the &amp;lt;h1&amp;gt; and &amp;lt;table&amp;gt; tags and replace them with the following code that is shown in bold.&lt;/p&gt;
          &lt;table border="1" bordercolor="#e7e7e7" cellpadding="2" cellspacing="0" class="examplecode"&gt;
      &lt;tr class="bg-white"&gt;
        &lt;td&gt;&lt;b&gt;Code Sample 6: Code for &lt;code&gt;index.html.erb&lt;/code&gt; &lt;/b&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;pre&gt;
&lt;b&gt;&amp;lt;h1&amp;gt;The Ruby Blog&amp;lt;/h1&amp;gt;

&amp;lt;% @posts.each do |post|  %&amp;gt;
  &amp;lt;h2&amp;gt;&amp;lt;%=h post.title %&amp;gt;&amp;lt;/h2&amp;gt;
  &amp;lt;p&gt;&amp;lt;%=h post.body %&amp;gt;&amp;lt;/p&amp;gt;
  &amp;lt;small&amp;gt;&amp;lt;%= link_to 'Permalink', post %&amp;gt;&amp;lt;/small&amp;gt;
  &amp;lt;hr&amp;gt;
&amp;lt;% end %&amp;gt;&lt;/b&gt;

&amp;lt;br /&amp;gt;

&amp;lt;%= link_to 'New post', new_post_path %&amp;gt;

&lt;/pre&gt;
&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt; 
	&lt;br&gt;
	&lt;p&gt;For each instance of a &lt;code&gt;post&lt;/code&gt; action, this code produces a 
	title, body, and Permalink. &lt;/p&gt;
	&lt;p&gt;Notice that the second parameter for &lt;tt&gt;link_to&lt;/tt&gt;
	is &lt;tt&gt;post&lt;/tt&gt;. You might remember that when
	you generated the scaffold, the generator added a
	&lt;tt&gt;map.resources :posts&lt;/tt&gt; declaration to the 
	&lt;tt&gt;routes.rb&lt;/tt&gt;. The resources method generates
	named routes for the Post model, one of which is
	&lt;tt&gt;post&lt;/tt&gt;.  The &lt;tt&gt;post&lt;/tt&gt; named route produces the same
	result as passing &lt;tt&gt;:action =&gt; 'show', :id =&gt; post&lt;/tt&gt;
	to the &lt;tt&gt;link_to&lt;/tt&gt; method. The post id is passed
	in the URL. When you click the Permalink link, look
	at the URL in the address bar. You should see a URL
	similar to &lt;tt&gt;http://localhost:3000/posts/1&lt;/tt&gt;.&lt;/p&gt;
	&lt;p&gt;To see all the named routes for a project, right-click
	the rubyweblog project node and choose Run Rake Task
	&amp;gt; routes. The Output window shows the route list.
	The first column shows the named route, the second and
	third columns show the HTTP verb and URL that are passed
	in the request, and the last column shows the controller
	and action that will be called.
	To learn more about using named routes
  see the Rails API for
	the
	&lt;a href="http://api.rubyonrails.org/classes/ActionController/Resources.html#M000308"
	&gt;ActionController:Resources&lt;/a&gt; class.
  &lt;/p&gt;
	
  &lt;/li&gt;
 
  &lt;li&gt;
    &lt;p&gt;Save the changes and run the application to see the new interface for the Post model. &lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To display the blog with the most recent entry first, 
		edit the code that you just added to reverse 
		the sort order by adding a call to the &lt;code&gt;.reverse&lt;/code&gt; 
		method, as shown below.&lt;/p&gt;
      &lt;pre&gt;&amp;lt;% @posts.&lt;b&gt;reverse.&lt;/b&gt;each do |post| %&amp;gt;
	  &lt;/pre&gt;&lt;/li&gt;
	  &lt;li&gt;Save the file and refresh your browser to see the list displayed
    in reverse order.&lt;/li&gt;
&lt;/ol&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/Ht28xC6K0mk" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/creating_a_rails_2_0</id>
        <title type="html">Creating a Rails 2.0 Ruby Weblog in 10 Minutes</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/creating_a_rails_2_0" />
        <published>2008-01-15T12:06:22-08:00</published>
        <updated>2008-06-07T09:56:17-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;p&gt;&lt;b&gt;THIS TUTORIAL IS FOR NETBEANS IDE 6.0. IF YOU ARE USING NETBEANS 6.1, SEE &lt;a href="http://www.netbeans.org/kb/61/ruby/model.html"&gt;THE UPDATED TUTORIAL&lt;/a&gt; ON THE NETBEANS &lt;A HREF="http://www.netbeans.org/kb/trails/ruby.html"&gt;RUBY TRAILS&lt;/A&gt; PAGE.&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; On 2/25/08, I updated Code Sample 3 to take advantage
the REST URLs and Path methods that the map.resources entity in the routes.rb generates. I also modified Step 3 in the last Doing More section to match the modified code.&lt;/p&gt; 
&lt;p&gt;Our Ruby weblog tutorial series for &lt;a href="http://download.netbeans.org/netbeans/6.0/final/"&gt;NetBeans IDE 6.0&lt;/a&gt; is written for Rails 1.2.5 and uses the ActionController scaffold method. The Rails 2.0 framework dropped this method, so the tutorials do not work if you have updated to Rails 2.0.&lt;/p&gt;
&lt;p&gt;We are now learning about the 2.0 changes so that we can produce updated tutorials. In the meantime, here is a quick draft of how to do the first weblog tutorial, &lt;a href="http://www.netbeans.org/kb/60/ruby/rapid-ruby-weblog.html"&gt;Creating a Ruby Weblog in 10 Minutes&lt;/a&gt;, using the Rails 2.0 framework and the NetBeans 6.0 IDE. We are still learning about the new Rails 2.0 features, so there will probably be many changes to come. Please consider this a &lt;i&gt;temporary&lt;/i&gt; document.&lt;/p&gt;
&lt;p&gt;Currently, this tutorial assumes that you are using a native Ruby interpreter, and have updated to Rails 2.0 (I believe you need to update RubyGems as well). There are many flavors of Ruby, one of which can
be download from &lt;a href="http://www2.ruby-lang.org/en/20020102.html"&gt;ww2.ruby-lang.org&lt;/a&gt;.
To learn how to set up the IDE to use a native Ruby interpreter, see
&lt;a href="http://www.netbeans.org/kb/60/ruby/setting-up.html#native"&gt;Installing and Configuring Ruby Support&lt;/a&gt;.&lt;/p&gt;

 &lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; This tutorial uses the MySQL database server. See &lt;a href="setting-up.html "
&gt;Installing and Configuring Ruby Support&lt;/a&gt;
for information about using a MySQL database server
in a Ruby application that is built using the NetBeans 6.0 IDE.&lt;/p&gt;


 &lt;h2&gt;Creating the Ruby on Rails Project &lt;/h2&gt;
 &lt;div&gt;You begin by creating a Ruby on Rails project.  By default, the application 
 is created in a directory structure that conforms to the Ruby on Rails project conventions for applications.&lt;/div&gt;
 &lt;ol&gt;
 
 &lt;li&gt;In the NetBeans IDE, choose File &amp;gt; New Project. &lt;/li&gt;
  &lt;li&gt;&lt;p&gt;Select Ruby in the Categories field and Ruby on Rails Application in the Projects field. Click Next. &lt;/p&gt;
 &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The first time that you create a Ruby project in the IDE, 
	the IDE checks if you have any other Ruby installations in addition to the bundled JRuby software. 
	If you do, the IDE displays a dialog box asking you to select which software to use. 
	Choose the native Ruby interpreter.&lt;/p&gt;
&lt;/li&gt;
  &lt;li&gt;
    Type &lt;code&gt;rubyweblog&lt;/code&gt; in the Project Name field.
Accept all the other default settings.   &lt;/li&gt;
	&lt;li&gt;&lt;p&gt;Click Finish to create the new project.&lt;/p&gt;
	
	&lt;p&gt;The IDE creates the project directory with the same name as your project.&lt;/p&gt;
	&lt;ul&gt;
   &lt;/li&gt;
	

&lt;/ol&gt;
&lt;h2&gt;Configuring the Database Environment&lt;/h2&gt;
&lt;div&gt;The next step is to edit the file database.yml, 


 which is already configured to use the MySQL
adapter and the development database. You do not need to do
any configuration unless the root user requires a password.&lt;/div&gt;
&lt;ol&gt;
  &lt;li&gt;In the editing area, edit the &lt;code&gt;database.yml&lt;/code&gt; by providing the password in the development configuration.&lt;/li&gt;
  &lt;li&gt;&lt;p&gt;Save and close the &lt;code&gt;database.yml&lt;/code&gt; file.&lt;/p&gt;
  &lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; If your operating system's host file does not
           contain &lt;tt&gt;localhost&lt;/tt&gt;, use  &lt;tt&gt;127.0.0.1&lt;/tt&gt; instead.
  &lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;&lt;p&gt;In the Projects window, right-click the rubyweblog project node, and choose Run Rake Task &amp;gt; db &amp;gt; create.&lt;/p&gt;
   Rake creates the MySQL database for the development configuration.
&lt;/ol&gt; 
&lt;a name="05"&gt;&lt;/a&gt;
&lt;h2&gt;Creating the Scaffold&lt;/h2&gt;
&lt;p&gt;Here you use the Rails Generator to create a scaffold and a model for the application. The rubyweblog application requires a Post model for storing instances of blog posts. &lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;p&gt;In the  Projects  window, right-click the rubyweblog project node and choose Generate.&lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;In the Rails Generator dialog box, choose scaffold from the Generate drop-down list.&lt;/p&gt;
     &lt;/li&gt;
     &lt;li&gt;
     &lt;p&gt;Type &lt;code&gt;Post title:string&lt;/code&gt; in the Model Name field and click OK (Controller Name and Actions not valid arguments in Rails 2.0). &lt;/p&gt;
   &lt;p&gt;The Rails Generator creates a model named Post, creates a migration file,
   and adds the controller and views for listing, creating, updating, and deleting posts. In addition, Rake edits the routes.rb file to map Post as a resource. The Output window lists the files that are created as part of the model generation.&lt;/p&gt;
   &lt;/li&gt;
&lt;/ol&gt;
  
	&lt;a name="06"&gt;&lt;/a&gt;
 &lt;h2&gt;Migrating the Database &lt;/h2&gt;
 &lt;div&gt;  The file that you work with next is the migration file, &lt;code&gt;001_create_posts.rb&lt;/code&gt;. 
 &lt;/div&gt;
 &lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;In the Output window, click the link for the &lt;code&gt;db/migrate/001_create_posts.rb&lt;/code&gt; file.&lt;/p&gt;
    &lt;p&gt;The file opens to show the &lt;code&gt;self.up&lt;/code&gt; method, which creates a table called posts, and the
    &lt;code&gt;self.down&lt;/code&gt; method, which tears the posts table down, as shown in the following code sample:&lt;/p&gt;

	 &lt;table border="1" bordercolor="#e7e7e7" cellpadding="2" cellspacing="0" class="examplecode"&gt;
      &lt;tr class="bg-white"&gt;
        &lt;td&gt;&lt;b&gt;Code Sample 1: Code for &lt;/b&gt;&lt;strong&gt;&lt;code&gt;001_create_posts.rb&lt;/code&gt;&lt;/strong&gt; &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;pre&gt;
class &lt;i&gt;CreatePosts &amp;lt; ActiveRecord::Migration&lt;/i&gt;
  def self.up
    create_table :posts do |t|
      t.string :title

      t.timestamps
    end
  end

  def self.down
    drop_table :posts
  end
end&lt;/pre&gt;
&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt; 
	&lt;br&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;In the Projects window, right-click the rubyweblog node and choose Migrate Database &amp;gt; To Current Version.&lt;/p&gt;
    &lt;p&gt;This action updates the the database to include the posts table. The Output window indicates when the migration is complete. &lt;/p&gt;
    Note that Rails 2.0 provides some new db Rake tasks, such
    as create (which you used earlier), drop, reset, rollback, and version.
&lt;/ol&gt;
  &lt;a name="07a"&gt;&lt;/a&gt;
&lt;h2&gt;Running the Application&lt;/h2&gt;
&lt;div&gt;Now test the application.&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
    &lt;p&gt;In the Projects window, expand the Configuration node and double-click &lt;code&gt;routes.rb&lt;/code&gt; to open it in the editor.  Find the comment:&lt;/p&gt;
	&lt;pre&gt;# map.root :controller =&amp;gt; "welcome"
	&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Add the following line under the comment:
	&lt;pre&gt;map.root :controller =&amp;gt; "posts"
	&lt;/pre&gt;
&lt;li&gt;
    &lt;p&gt;Expand the Public node, right-click index.html and choose Delete.&lt;/p&gt;
    &lt;p&gt;&lt;code&gt;index.html&lt;/code&gt; displays a default Welcome page, which is not what you want. By deleting &lt;code&gt; index.html&lt;/code&gt;, Rails looks in &lt;code&gt;routes.rb&lt;/code&gt; to figure out what page to display.
&lt;/li&gt;
  &lt;li&gt;Choose File &gt; Save All.&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Click the Run Main Project button in the toolbar.&lt;/p&gt;
	&lt;p&gt;This action starts the WEBrick server, which is part of the Ruby on Rails framework, and launches the web browser.&lt;/p&gt;
&lt;p&gt;If you are using a server other than WEBrick, you might need to enter
&lt;code&gt;http://localhost:3000&lt;/code&gt; in the browser's address text box and press Enter.&lt;/p&gt;
  &lt;/li&gt;
	&lt;li&gt;
	  &lt;p&gt;Click the New post link to display the second page of the application. &lt;/p&gt;
  &lt;/li&gt;
		&lt;li&gt;
		  &lt;p&gt;Enter a title and click Create.&lt;/p&gt;
		&lt;/li&gt;

  
&lt;/ol&gt;
&lt;a name="08"&gt;&lt;/a&gt;

&lt;h2&gt; Doing More: Adding Another Field &lt;/h2&gt;
&lt;p&gt;Here you add another field so that, in addition to the Title field, the posts table includes a Body column for providing the text of the blog.&lt;/p&gt;
  &lt;ol&gt;
    &lt;li&gt;
      &lt;p&gt;Right-click the Database Migrations node and choose Generate. In the Rails Generator dialog box, type &lt;code&gt;AddBodyToPost body:text&lt;/code&gt; in the Arguments field and click OK.&lt;/p&gt;
	  &lt;p&gt;The IDE creates the versioned migration script &lt;code&gt;002_add_body_to_post.rb&lt;/code&gt;. The file opens to show the &lt;code&gt;self.up&lt;/code&gt; method, which adds a body column, and the
    &lt;code&gt;self.down&lt;/code&gt; method, which removes the column, as shown in the following code sample:&lt;/p&gt;

	 &lt;table border="1" bordercolor="#e7e7e7" cellpadding="2" cellspacing="0" class="examplecode"&gt;
      &lt;tr class="bg-white"&gt;
        &lt;td&gt;&lt;b&gt;Code Sample 2: Code for &lt;/b&gt;&lt;strong&gt;&lt;code&gt;002_add_body_to_post.rb&lt;/code&gt;&lt;/strong&gt; &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;pre&gt;
class AddBodyToPost &amp;lt; ActiveRecord::Migration
  def self.up
    add_column :posts, :body, :text
  end

  def self.down
    remove_column :posts, :body
  end
end&lt;/pre&gt;
&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt; 
	&lt;br&gt;
    &lt;/li&gt;
	&lt;li&gt;Choose File &gt; Save All.&lt;/li&gt;
    &lt;li&gt;
        &lt;p&gt;Right-click the rubyweblog node and choose Migrate Database &amp;gt; To Current Version.&lt;/p&gt;
        Alternatively, right-click in the source file and choose Run File from the pop-up menu.
    &lt;/li&gt;
&lt;li&gt;
  &lt;p&gt;Typically, you would now edit the views to add the new field. For
  this tutorial, you will simply regenerate the scaffold.  In the  Projects  window, right-click the rubyweblog project node and choose Generate.&lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;In the Rails Generator dialog box, choose scaffold from the Generate drop-down list.&lt;/p&gt;
     &lt;/li&gt;
     &lt;li&gt;
     &lt;p&gt;Type &lt;code&gt;Post title:string body:text --skip-migration&lt;/code&gt; in the Model Name field. &lt;/p&gt;
  
  &lt;/li&gt;
  &lt;li&gt;&lt;p&gt;Select the Overwrite radio button.&lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;&lt;p&gt;Click OK.&lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;&lt;p&gt;Return to the browser and click the New Post link to see how Ruby recognizes the new body field. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a few more blog entries.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;a name="09a"&gt;&lt;/a&gt;

&lt;h2&gt;Doing More: Validating Input&lt;/h2&gt;
&lt;a name="09"&gt;&lt;/a&gt;
&lt;div&gt;
Here, you add code to the Post class to ensure that the users provide values
for both the title and the body fields.
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;In the Projects window, expand the Models node and double-click post.rb
to open the file in the editor.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open up a line inside the Class definition, type &lt;tt&gt;vp&lt;/tt&gt;,
then press Tab.&lt;/p&gt;
The IDE replaces the &lt;tt&gt;vp&lt;/tt&gt; trigger with the following code template:
&lt;pre&gt;validates_presence_of :attribute&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Type &lt;tt&gt;title, :body&lt;/tt&gt;. The code should look like the
following statement:
&lt;pre&gt;validates_presence_of :title, :body&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run the application, click New Post, and click Create.&lt;/p&gt;
The application now reports that the title and body cannot be blank.
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Doing More: Making the List Look More Like a Blog&lt;/h2&gt;
&lt;ol&gt;

  &lt;li&gt;
    &lt;p&gt;Expand Views &gt; posts and open &lt;code&gt;index.html.erb,&lt;/code&gt; which is used to show the list of blog entries.  Delete the &amp;lt;h1&amp;gt; and &amp;lt;table&amp;gt; tags and replace them with the following code that is shown in bold:&lt;/p&gt;
          &lt;table border="1" bordercolor="#e7e7e7" cellpadding="2" cellspacing="0" class="examplecode"&gt;
      &lt;tr class="bg-white"&gt;
        &lt;td&gt;&lt;b&gt;Code Sample 3: Code for &lt;code&gt;index.html.erb&lt;/code&gt; &lt;/b&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;pre&gt;
&lt;b&gt;&amp;lt;h1&amp;gt;The Ruby Blog&amp;lt;/h1&amp;gt;

&amp;lt;% for post in @posts %&amp;gt;
  &amp;lt;h2&amp;gt;&amp;lt;%=h post.title %&amp;gt;&amp;lt;/h2&amp;gt;
  &amp;lt;p&gt;&amp;lt;%=h post.body %&amp;gt;&amp;lt;/p&amp;gt;
  &amp;lt;small&amp;gt;&amp;lt;%= link_to 'Permalink', post %&amp;gt;&amp;lt;/small&amp;gt;
  &amp;lt;hr&amp;gt;
&amp;lt;% end %&amp;gt;&lt;/b&gt;

&amp;lt;br /&amp;gt;

&amp;lt;%= link_to 'New post', new_post_path %&amp;gt;

&lt;/pre&gt;
&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt; 
	&lt;br&gt;
	&lt;p&gt;For each instance of a &lt;code&gt;post&lt;/code&gt; action, this code produces a 
	title, body, and Permalink. &lt;/p&gt;
  &lt;/li&gt;
 
  &lt;li&gt;
    &lt;p&gt;Run the application to see the new interface for the Post model. &lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To display the blog with the most recent entry first, reverse the sort order by adding &lt;code&gt;.reverse&lt;/code&gt; to the end of &lt;code&gt;@posts&lt;/code&gt; in &lt;code&gt;index.html.erb&lt;/code&gt;:&lt;/p&gt;
      &lt;pre&gt;
	  &amp;lt;% for post in @posts.reverse %&amp;gt;
	  &lt;/pre&gt;
	  &lt;p&gt;Save the file and refresh your browser to see the list displayed
    in reverse order.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/albNuwlDNQg" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/adding_a_popup_window_to1</id>
        <title type="html">Adding a Popup Window to a NetBeans 6.0 Visual Web Page</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/adding_a_popup_window_to1" />
        <published>2008-01-03T11:49:59-08:00</published>
        <updated>2008-01-03T11:49:59-08:00</updated> 
        <category term="/NetBeans Visual Web Pack" label="NetBeans Visual Web Pack" />
        <category term="javascript" scheme="http://roller.apache.org/ns/tags/" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="table" scheme="http://roller.apache.org/ns/tags/" />
        <category term="vwp" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;img src="http://blogs.sun.com/divas/resource/popup.gif"&gt;


&lt;p&gt;Here is a mini-tutorial for creating a Popup window for the user to lookup  values. One scenario that you might use this for is when the page visitor needs  more information then can be displayed in a drop-down list. &lt;/p&gt;
&lt;p&gt;This is a rewrite of a &lt;a href="http://blogs.sun.com/divas/entry/adding_a_popup_window_to"&gt;previous blog entry&lt;/a&gt; that was written for the Sun Java Studio Creator IDE. I have modified the steps so that it works for the NetBeans 6.0 IDE.&lt;/p&gt;

&lt;ol&gt;
 &lt;li&gt;Create a web application project with the Visual Web JavaServer Faces framework.&lt;br&gt;
   &lt;br&gt;
 &lt;/li&gt;
 &lt;li&gt;Add a page named &lt;code&gt;Popup&lt;/code&gt;.&lt;br&gt;

   &lt;br&gt;
 &lt;/li&gt;
 &lt;li&gt;Add a Table component to the page.&lt;br&gt;
   &lt;br&gt;
 &lt;/li&gt;
 &lt;li&gt;Drag VIR &amp;gt; Tables &amp;gt; State from the Services window and drop it on the    table.&lt;br&gt;

   &lt;br&gt;
 &lt;/li&gt;
 &lt;li&gt;Right-click the Table component and choose Table Layout from the pop-up    menu.&lt;br&gt;
   &lt;br&gt;
 &lt;/li&gt;
 &lt;li&gt;In the column for the STATE.STATEID database field, set the Component Type    to Hyperlink, and click OK.&lt;br&gt;
   &lt;br&gt;
 &lt;/li&gt;

 &lt;li&gt;Select the Hyperlink component so that its properties appear in the Properties    window.&lt;br&gt;
   &lt;br&gt;
 &lt;/li&gt;
 &lt;li&gt;Set the value for the &lt;code&gt;onClick&lt;/code&gt; property to &lt;code&gt;doSave('#{currentRow.value['STATE.STATEID']}')&lt;/code&gt;    &lt;br&gt;
   &lt;br&gt;

   (I got the value to pass to doSave() from the Value Expression in the Table    Layout dialog).&lt;br&gt;
   &lt;br&gt;
 &lt;/li&gt;
 &lt;/li&gt;
 &lt;li&gt;Drag a Script component from the Advanced section of the Palette
and drop it on the page.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;

 &lt;li&gt;Click JSP in the editing toolbar to view the JavaServer Pages script.&lt;br&gt;
   &lt;br&gt;

 &lt;li&gt;In the JSP page, change the &amp;lt;webuijsf:script&amp;gt; tag
as shown below.
   &lt;br&gt;

   &lt;br&gt;
   &lt;table cellpadding="5"&gt;
     &lt;tr&gt;        &lt;td&gt;&amp;nbsp;&lt;/td&gt;
       &lt;td bgcolor="#E1DAE4"&gt; &lt;pre&gt;
&amp;lt;webuijsf:script binding="#{Popup.script1}" id="script1"&amp;gt;
&amp;lt;![CDATA[
function doSave(val) {
 window.opener.setVal(val);
 window.close();
}]]&amp;gt;
&amp;lt;/webuijsf:script&amp;gt;
&lt;/pre&gt;&lt;/td&gt;

     &lt;/tr&gt;
   &lt;/table&gt;
   &lt;br&gt;
   &lt;br&gt;
   The Popup page is now ready for use by another page.&lt;br&gt;
   &lt;br&gt;
 &lt;/li&gt;
 &lt;li&gt; Create a new page called&lt;code&gt; Form1&lt;/code&gt;. Make it be the start page.    &lt;br&gt;

   &lt;br&gt;
 &lt;/li&gt;

 &lt;li&gt;Drag a Text Field component and drop it on the page. In the Properties
window, make sure the id is set to 
textField1.&lt;br&gt;
   &lt;br&gt;
 &lt;/li&gt;
 &lt;li&gt;Drop a Hyperlink component on the page, just above the text field, and set the &lt;code&gt;text&lt;/code&gt; property    to &lt;code&gt;State Code&lt;/code&gt;.&lt;br&gt;
   &lt;br&gt;
 &lt;/li&gt;
 &lt;li&gt;Set the &lt;code&gt;url&lt;/code&gt; property to &lt;code&gt;/faces/Popup.jsp&lt;/code&gt;.&lt;br&gt;

   &lt;br&gt;
 &lt;/li&gt;
 &lt;li&gt;Set the &lt;code&gt;onClick&lt;/code&gt; property to &lt;code&gt;doPopup('form1:textField1_field')&lt;/code&gt;&lt;br&gt;
   &lt;br&gt;
   Note: Here you are passing the id of the field to fill with the selected value.    
   Determining the id can be tricky. 
   To determine what to use for the id, run the application, and use a tool
such as Firebug to inspect the DOM.&lt;br&gt;
   &lt;br&gt;
 &lt;/li&gt;
 &lt;li&gt; Click the ... button for the target property to open the target property    editor.&lt;br&gt;
   &lt;br&gt;

 &lt;/li&gt;
 &lt;li&gt;In the property editor, click New and set both the Display and Value to    &lt;code&gt;popup&lt;/code&gt;. Click OK and click OK again.&lt;br&gt;
   &lt;br&gt;
   Later you add script to open a window named popup, and this setting causes    the Popup.jsp page to display in that window.&lt;br&gt;
   &lt;br&gt;
 &lt;/li&gt;
 &lt;li&gt;If the &lt;code&gt;target&lt;/code&gt; property value is still blank, select popup from    the value from the combobox for that property.&lt;br&gt;

   &lt;br&gt;
 &lt;/li&gt;
&lt;li&gt;Drag a Script component from the Advanced section of the Palette
and drop it on the page.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;
 &lt;li&gt;Click JSP in the editing toolbar to view the JavaServer Pages script.&lt;br&gt;
   &lt;br&gt;
 &lt;/li&gt;

 
 &lt;li&gt;In the JSP page, change the &amp;lt;webuijsf:script&amp;gt; tag
as shown below.
   &lt;br&gt;

   &lt;br&gt;
   &lt;table cellpadding="5"&gt;
     &lt;tr&gt;        &lt;td&gt;&amp;nbsp;&lt;/td&gt;
       &lt;td bgcolor="#E1DAE4"&gt; &lt;pre&gt;
&amp;lt;webuijsf:script binding="#{Form1.script1}" id="script1"&amp;gt;
&amp;lt;![CDATA[
function doPopup(destination) {
 popup = window.open("", "popup",
 "height=300,width=200,toolbar=no, menubar=no,scrollbars=yes");
 destinationElement=document.getElementById(destination);
 popup.focus();
}

function setVal(val){
 destinationElement.value=val;
}]]&amp;gt;&amp;lt;/webuijsf:script&amp;gt;&lt;/b&gt;
&lt;/pre&gt;&lt;/td&gt;
     &lt;/tr&gt;
   &lt;/table&gt;
   &lt;br&gt;
   &lt;br&gt;
 &lt;/li&gt;
 &lt;li&gt;Run the project. Click State Code to open the popup window. Click a state    code to select the code, close the popup window, and populate the text field.  &lt;/li&gt;
&lt;/ol&gt; &lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/_9JJswXGieQ" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/five_minute_ruby_jmaki_tutorial</id>
        <title type="html">Five-Minute Ruby on Rails jMaki Tutorial</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/five_minute_ruby_jmaki_tutorial" />
        <published>2007-12-14T16:01:35-08:00</published>
        <updated>2007-12-15T02:00:03-08:00</updated> 
        <category term="/AJAX" label="AJAX" />
        <category term="ajax" scheme="http://roller.apache.org/ns/tags/" />
        <category term="jmaki" scheme="http://roller.apache.org/ns/tags/" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <category term="yahoo" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;img src="http://blogs.sun.com/divas/resource/simplerubytable.png" align = "right"&gt;
&lt;p&gt;If you have installed the NetBeans IDE support for Ruby and you are interested in integrating &lt;a href="http://www.jmaki.com/"&gt;jMaki&lt;/a&gt; in your Ruby on Rails projects, here is a five-minute tutorial that will get you started. In this tutorial, you add a Yahoo data table to a Ruby on Rails view. (If you have not yet installed the NetBeans IDE 6.0 or if you need to add Ruby support to your NetBeans IDE, learn how to &lt;a href="http://www.netbeans.org/kb/60/ruby/setting-up.html"&gt;here&lt;/a&gt;.)&lt;/p&gt;
&lt;br&gt;
&lt;ol&gt;
&lt;li&gt;If you haven't installed the jMaki plugin for the NetBeans IDE, it takes just a minute. Select &lt;b&gt;Tools &amp;gt; Plugins&lt;/b&gt; from the main menu, select &lt;b&gt;jMaki Ajax Support&lt;/b&gt;, click Install and follow the instructions.
&lt;br&gt;&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
Follow the steps in the "Working With Ruby on Rails Files" section in the &lt;a href="http://www.netbeans.org/kb/60/ruby/getting-started.html#workingrails"&gt;Getting Started With Ruby and Rails&lt;/a&gt;. This should take just a few minutes as no database is involved. Finish all the steps up to but not including the "Practicing What You Have Learned" subsection. It is important that you add the routing code (Code Sample 10) to the &lt;tt&gt;routes.rb&lt;/tt&gt; file and delete the &lt;b&gt;Public &amp;gt; index.html&lt;/b&gt; file.
&lt;br&gt;&lt;br&gt;
&lt;b&gt;Note: &lt;/b&gt; If you already have done these sections, but added the jMaki plugin after you created the project, you need to create a new project in order to have jMaki included.
&lt;br&gt;&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;Edit the &lt;b&gt;Views &amp;gt; item &amp;gt; index.rhtml&lt;/b&gt; file.&lt;br&gt;&lt;br&gt;&lt;/li&gt;
&lt;li&gt;Remove the &lt;b&gt;&amp;lt;table&amp;gt;&lt;/b&gt; including the nested &lt;b&gt;&amp;lt;tr&amp;gt;&lt;/b&gt; and &lt;b&gt;&amp;lt;td&amp;gt;&lt;/b&gt; tags. You
will replace this HTML table with the Yahoo Data Table.&lt;br&gt;&lt;br&gt;&lt;/li&gt;
&lt;li&gt;Choose &lt;b&gt;Window &amp;gt; Palette&lt;/b&gt; from the main menu to view the Palette window.&lt;br&gt;&lt;br&gt;&lt;/li&gt;
&lt;li&gt;Expand the &lt;b&gt;jMaki Yahoo&lt;/b&gt; section in the Palette, then drag and drop the
&lt;b&gt;Data Table&lt;/b&gt; onto the &lt;b&gt;index.rhtml&lt;/b&gt;.&lt;br&gt;&lt;br&gt;&lt;/li&gt;
&lt;li&gt;Replace the &lt;b&gt;jmaki_widget&lt;/b&gt; tag with the following code:

&lt;br&gt;&lt;br&gt;
&lt;table border="1" bordercolor="#e7e7e7" cellpadding="2" cellspacing="0" class="examplecode"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;pre&gt;
&amp;lt;%= jmaki_widget 'yahoo.dataTable',
:value =&amp;gt;
{:columns =&amp;gt; [
     { :label =&gt; 'Id', :id =&amp;gt; 'id'},
     { :label =&gt;'Type', :id =&amp;gt; 'type'},
     { :label =&gt; 'Price', :id =&amp;gt; 'price'},
     ],
  :rows =&gt; @items
  }
-%&amp;gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br&gt;&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;Click the small &lt;b&gt;x&lt;/b&gt; button in the bottom right corner of the IDE to stop the
WEBrick server.&lt;br&gt;&lt;br&gt;&lt;/li&gt;
&lt;li&gt;Click the &lt;b&gt;Run Main Project&lt;/b&gt; button and the browser should display a nice Yahoo table that contains the item data.
&lt;/li&gt;
&lt;/ol&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/DgOZj0k7PCk" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/how_do_you_rubh</id>
        <title type="html">How Do You Ruby?</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/how_do_you_rubh" />
        <published>2007-12-04T13:58:52-08:00</published>
        <updated>2007-12-04T13:58:52-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;img src="http://blogs.sun.com/divas/resource/TURTLE_4587.jpg" valign="top" align = "right" border=1 hspace=5&gt;
&lt;p&gt;During your daily use of the NetBeans Ruby support, you are constantly  figuring out how to best use the language and the IDE to help you get your job done. Hopefully, the tutorials and articles help you towards your goals, but one size does not fit all. You all have  diverse perspectives of the product as you implement your different use cases and scenarios. In addition, you bring with you different sets of habits, mental models, processes, and standards.
&lt;/p&gt;
&lt;p&gt;
As you work with the product, you gain valuable nuggets of information that would be of  benefit to others who run into the same situations. The NetBeans Ruby community wiki provides the means to share that knowledge.
&lt;/p&gt;

&lt;p&gt;You might think that you have to be a subject matter expert before you can contribute, but that is far from true. Often, people who are new to using the NetBeans Ruby support are the perfect teachers for other beginners. You can understand and emphasize with them, and you are probably encountering the same bumps, hurdles, and misunderstandings.  Or maybe you are just one step ahead and can help others from making the same mistakes. Also, the act of writing might make your own understanding all that more concrete.&lt;/p&gt;

&lt;p&gt;There are many ways in which you can be involved in the NetBeans Ruby community.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Users Alias.&lt;/b&gt; The &lt;a href="http://www.nabble.com/NetBeans-Ruby---Users-f27022.html"
&gt;users@ruby.netbeans.org&lt;/a&gt; email alias is a quick and easy way ask questions and help out others. An added advantage is that the developers are listening and many improvements have been made to the product because people took the time to write their issues and wishes. Often times, during the act of describing your problem concisely, you get the big Aha! that makes the answer obvious. In  that case, since you have already written up the problem, you might as well share your problem and solution with the community.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
&lt;b&gt;FAQs.&lt;/b&gt; The &lt;a href="http://wiki.netbeans.org/wiki/view/RubyFAQ"&gt;FAQ&lt;/a&gt; is composed of easy to create and edit wiki pages. The users alias is a good place to look up solutions, but even better is when someone takes the time to summarize a long thread from the users alias into one page of essential information. Another good use for FAQs is to share gotchas and tips.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
&lt;b&gt;Blogs, Tutorials, and Articles.&lt;/b&gt; If you blog about NetBeans Ruby support, notify the users alias so we can link to you. If you want to write a tutorial or article, get in touch with the NetBeans Community Docs Contribution Coordinator Amit Kumar Saha (See &lt;a href="http://wiki.netbeans.org/wiki/view/CommunityDocs"&gt;Community Docs&lt;/a&gt; for instructions). Also let us know, so we can link to your doc from the &lt;a href="http://wiki.netbeans.org/wiki/view/RubyDocumentation"&gt;Ruby Documentation&lt;/a&gt; wiki page. We will also be glad to help you with reviews and such.&lt;br&gt;&lt;br&gt;
&lt;/li&gt;&lt;li&gt;
&lt;b&gt;Submit Code.&lt;/b&gt; The &lt;a href="http://wiki.netbeans.org/wiki/view/RubyParticipation"&gt;
Ruby Participation&lt;/a&gt; wiki page tells how to join the development effort. The &lt;a href="http://wiki.netbeans.org/wiki/view/RubyCodeIdeas"&gt;
Ruby Code Ideas&lt;/a&gt; wiki page lists possible projects to work on -- both large and small. Two other ways to contribute are to submit Ruby hints and quick fixes (see &lt;a href="http://wiki.netbeans.org/wiki/view/RubyAddHints"
&gt;Writing New Ruby Hints&lt;/a&gt;) and provide suggestions for 
&lt;a href="http://wiki.netbeans.org/wiki/view/RubyCodeTemplates"
&gt;Ruby code templates&lt;/a&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
So, how do you Ruby? Got a nugget to share? We would love to hear from you.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/wX2bTZ7atyc" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/screencasts_of_netbeans_ruby</id>
        <title type="html">The NetBeans Ruby Screencast Library</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/screencasts_of_netbeans_ruby" />
        <published>2007-11-30T14:10:25-08:00</published>
        <updated>2007-12-07T10:36:24-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="rails" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html"> &lt;p&gt;
Recently we posted a list of tutorials to help you get started with NetBeans Ruby and Rails.  Another way to get started is by watching the NetBeans Ruby screencasts, starring Tor Norbye and Roman Strobl, and produced by Cindy Church. These screencasts provide an overview of the features of NetBeans Ruby, including the Ruby Editor and Debugger, and also provide scenarios for creating Ruby and Rails applications. Sit back, relax, and enjoy.
&lt;/p&gt;
&lt;h3&gt;Creating Ruby and Rails Applications&lt;/h3&gt;
 &lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.netbeans.tv/screencasts/Tor-Norbye-Uses-NetBeans-Ruby-Support-to-Create-a-Weblog-231/"&gt;Using Ruby Support to Create a Weblog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.netbeans.tv/interviews/Tor-Norbye-mixes-Ruby-and-Java-development-using-NetBeans-151/"&gt;Mixing Java and Ruby Development&lt;/a&gt;
&lt;/ul&gt;
&lt;h3&gt;Using the Ruby Editor &lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.netbeans.org/download/flash/jruby_editing/jruby_editing.html"&gt;Editing Ruby Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://netbeans.tv/technologies/Tor-Norbye-uses-NetBeans-Ruby-Editor-Code-Completion-169/"&gt;Using Code Completion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://netbeans.tv/technologies/Tor-Norbye-uses-hints-and-quick-fixes-in-NetBeans-Ruby-Editor-170/"&gt; Using Hints and Quick Fixes&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h3&gt;Testing and Debugging&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.netbeans.tv/screencasts/Tor-Norbye-Writes-Unit-Tests-Using-the-NetBeans-Ruby-Support-246/"&gt; Writing Unit Tests&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.netbeans.tv/technologies/Roman-Strobl-Demonstrates-the-NetBeans-Ruby-Debugger-193/"&gt;Debugging Ruby Code&lt;/a&gt;
&lt;/li&gt;
     &lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/A4ieb8v288o" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/ruby_learning_path_constructing_the</id>
        <title type="html">My Ruby Learning Path: Constructing the Constructor</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/ruby_learning_path_constructing_the" />
        <published>2007-11-27T16:09:18-08:00</published>
        <updated>2007-11-27T16:09:18-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://roller.apache.org/ns/tags/" />
        <category term="ruby" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;img src="http://blogs.sun.com/divas/resource/rockpiles.jpg" border="1" align="left" hspace="10" vspace="10"&gt;
&lt;p&gt;When I started learning Ruby, all of the code samples that I looked at used positional arguments in the constructor, such as with the following code:
&lt;/p&gt;
&lt;pre&gt;
  def initialize(id, type, price)
    @id, @type, @price = id, type, price
  end
&lt;/pre&gt;
&lt;p&gt;
By positional arguments, I mean that the first argument must pass the id, the second must pass type, and the third must pass price. Having worked with C and Java, this feels very familiar, and so that is how I did
it in my own code. However, when I posted my code samples to the &lt;a href="http://www.nabble.com/NetBeans-Ruby---Dev-f27020.html"&gt;dev@ruby.netbeans.org&lt;/a&gt; alias, a few developers suggested that I use a hash, like in the following code.&lt;/p&gt;
&lt;br clear="left" /&gt;
&lt;pre&gt;
  def initialize(attributes)
    @id = attributes['id']
    @type = attributes['type']
    @price = attributes['price'].to_f
  end
&lt;/pre&gt;
&lt;p&gt;I can see some advantages of using a hash instead of requiring arguments in a certain order. For one, with positional arguments, there is the possibility of passing the values in the wrong order. Another advantage of a hash is that if you add more attributes to a class, the constructor's signature does not change.
&lt;/p&gt;
&lt;p&gt;There was a bit of a debate about which version to use. Some developers like the constructor with positional arguments because it clearly documents the intent of the class. Others feel that keyword arguments, along with RDoc, make the code more clear than depending on argument ordering to convey meaning. Comparing the two types of method invocations, I have to agree that the hash seems easier to read.&lt;/p&gt;
&lt;pre&gt;
  Item.new 'id' =&gt; 'ABC', type' =&gt; 'book',  'price' =&gt; 17

  Item.new 'ABC', 'book', 23
&lt;/pre&gt;
&lt;p&gt;How about you? What are your preferences? Do you carry it even further? Would you ever consider doing something like this?&lt;/p&gt;
&lt;pre&gt;

  def initialize(&amp;block)
    instance_eval &amp;block
  end

  item = Item.new do
    self.id = 'ABC'
    ...
  end

&lt;/pre&gt;
&lt;p&gt;Do you know of scenarios where it might be appropriate to use code like this?&lt;/p&gt;
&lt;pre&gt;
  def initialize(attributes)
    @attributes = attributes.with_indifferent_access
  end
 
  def method_missing(symbol, *args)
    @attributes[symbol] ? @attributes[symbol] : super
  end
&lt;/pre&gt;
&lt;p&gt;Charles Nutter has &lt;a href="http://headius.blogspot.com/2007/06/creating-field-initializing-new-method.html"&gt;blogged&lt;/a&gt; about how to extend Class with a field-initializing 'new' method. Jay Fields posted in his &lt;a href="http://blog.jayfields.com/2007/04/ruby-assigning-instance-variables-in.html"&gt;blog&lt;/a&gt; code forcreating constructors that can take either positional arguments or a hash. For someone starting out with Ruby, I find these latter methods a bit uncomfortable, but it does save a bit of finger work. What do you think?
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/EqOhplkjOug" height="1" width="1"/&gt;</content>
    </entry>
</feed>
