<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="http://feeds.feedburner.com/~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>2008-05-12T10:00:50-07:00</updated>
    <generator uri="http://roller.apache.org" version="4.0-dev (20080318124621)">Apache Roller Weblogger</generator>
        <link rel="self" href="http://feeds.feedburner.com/InsiderScoopFromTheTutorialDivas" type="application/atom+xml" /><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://rollerweblogger.org/ns/tags/" />
        <category term="dynamicfaces" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="javaone" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="javaone2008" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="jsf" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="rails" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="ruby" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="vwp" scheme="http://rollerweblogger.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/266557959" 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://rollerweblogger.org/ns/tags/" />
        <category term="rails" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="ruby" scheme="http://rollerweblogger.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/258643204" 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://rollerweblogger.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/253321212" 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://rollerweblogger.org/ns/tags/" />
        <category term="rails" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="ruby" scheme="http://rollerweblogger.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/243557401" 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-02-27T11:54:10-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="rails" scheme="http://rollerweblogger.org/ns/tags/" />
        <content type="html">&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/217237355" 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://rollerweblogger.org/ns/tags/" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="table" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="vwp" scheme="http://rollerweblogger.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/210707250" 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://rollerweblogger.org/ns/tags/" />
        <category term="jmaki" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="rails" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="ruby" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="yahoo" scheme="http://rollerweblogger.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/200543998" 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://rollerweblogger.org/ns/tags/" />
        <category term="ruby" scheme="http://rollerweblogger.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/195205890" 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://rollerweblogger.org/ns/tags/" />
        <category term="rails" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="ruby" scheme="http://rollerweblogger.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/193181586" 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://rollerweblogger.org/ns/tags/" />
        <category term="ruby" scheme="http://rollerweblogger.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/191559159" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/getting_started_with_netbeans_ruby</id>
        <title type="html">Getting Started With NetBeans Ruby and Rails</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/getting_started_with_netbeans_ruby" />
        <published>2007-11-26T18:02:13-08:00</published>
        <updated>2007-12-06T14:53:29-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="rails" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="ruby" scheme="http://rollerweblogger.org/ns/tags/" />
        <content type="html">&lt;p&gt;
Do you need help getting started with NetBeans Ruby?  If so, we have three learning trails to get you going. Our first trail gives you a whirlwind tour of the NetBeans Ruby and Ruby on Rails environment. The second trail provides the nuts and bolts for creating a basic Ruby on Rails application. The third trail is an all-in-one lesson for working with Ruby and Java applications.  You can start at whatever trail best meets your needs.&lt;/p&gt;
&lt;h3&gt;Trail 1:  Getting Started&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.netbeans.org/kb/60/ruby/setting-up.html"&gt;Installing and Configuring Ruby Support, Databases, and GlassFish&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.netbeans.org/kb/60/ruby/getting-started.html"&gt;Getting Started With Ruby and Rails&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Trail 2:  Creating a Ruby on Rails Application&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&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;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.netbeans.org/kb/60/ruby/model.html"&gt;Building Relationships Between Rails Models&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://www.netbeans.org/kb/60/ruby/ajax.html"&gt;Using Ajax with Ruby on Rails&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Trail 3: Integrating Ruby and Java Development&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.netbeans.org/kb/60/ruby/java-ruby.html"&gt;Mixing Java and Ruby Applications&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/191358269" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/getting_your_feet_wet_with</id>
        <title type="html">Getting Your Feet Wet With Java in JRuby</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/getting_your_feet_wet_with" />
        <published>2007-11-13T15:35:00-08:00</published>
        <updated>2007-11-15T16:43:05-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="irb" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="jirb" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="jruby" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="ruby" scheme="http://rollerweblogger.org/ns/tags/" />
        <content type="html">&lt;img src="http://blogs.sun.com/divas/resource/jrubylogo.gif" align="left"  border="0" hspace = "10"&gt;&lt;p&gt;If you haven't tried calling Java classes from a JRuby application yet, here is a simple code snippet to get you started. Paste the following code into the Ruby shell (JRuby IRB), press Enter, and a small desktop app opens (To open the Ruby shell in the NetBeans IDE, choose &lt;b&gt;Ruby &amp;gt; Other &amp;gt; Ruby Shell (IRB)&lt;/b&gt; from the main menu). This code is an updated version of an example in the &lt;a href="http://java.sun.com/developer/technicalArticles/scripting/jruby/index.html"
&gt;JRuby and the Java Platform&lt;/a&gt; article.
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; A current known bug causes the JRuby IRB to report an ExitSecurityException, this bug does not affect the output.&lt;/p&gt;

               &lt;table border="1" bordercolor="#e7e7e7" cellpadding="2" cellspacing="0" &gt;
                    &lt;tr class="bg-white"&gt;
                        &lt;td&gt;&lt;b&gt;Code Sample: Using Java Classes in the IRB Console&lt;/b&gt;&lt;/td&gt;

                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;&lt;pre&gt;
include Java

import javax.swing.JFrame
import javax.swing.JLabel
import javax.swing.JPanel
import javax.swing.JButton
import java.awt.BorderLayout

frame = JFrame.new
panel = JPanel.new
panel.layout = BorderLayout.new
panel.background = java.awt.Color::white
frame.get_content_pane.add(panel)
frame.default_close_operation = JFrame::EXIT_ON_CLOSE
button = JButton.new "Click Me"
text = JLabel.new "I'm a Simple Program"

panel.add(BorderLayout::CENTER, text)
panel.add(BorderLayout::SOUTH, button)

class Click
    include java.awt.event.ActionListener

    def initialize(button, text)
        @button, @text = button, text
        @click_me_mode = true
    end

    def actionPerformed(event)
        source = event.source
        if (source == @button)
            if (@click_me_mode)
                @text.text = "Button Clicked"
                @button.text = "Click Again"
                @click_me_mode = false
            else
                @text.text = "I'm a Simple Program"
                @button.text = "Click Me"
                @click_me_mode = true
            end
        end
    end
end

button.add_action_listener(Click.new(button, text))
frame.title = "Example"
frame.pack
frame.visible = true &lt;/pre&gt;
                        &lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/table&gt;
&lt;p&gt;The IRB is a nice way to test out your code. However, with the NetBeans IDE, it is just as easy to test out code in a scratch program. To see what I mean, right-click in the NetBeans &lt;b&gt;Projects&lt;/b&gt; window and choose &lt;b&gt;New &amp;gt; Project&lt;/b&gt;. In the New Project wizard, select &lt;b&gt;Ruby&lt;/b&gt; in the Categories pane, select &lt;b&gt;Ruby Application&lt;/b&gt; in the Projects pane, and click &lt;b&gt;Next&lt;/b&gt;. Name the project &lt;tt&gt;Scratch&lt;/tt&gt; (or whatever you want) and click Finish. The &lt;tt&gt;main.rb&lt;/tt&gt; file opens in the editor.
&lt;/p&gt;
&lt;p&gt;Replace the contents of the &lt;tt&gt;main.rb&lt;/tt&gt; file with the code sample. Then click the &lt;b&gt;Run Main Project&lt;/b&gt; button in the main toolbar (the green arrow) to run the application.&lt;/p&gt;
&lt;p&gt;As you can see by the following screenshot, the advantage of testing your code in a scratch project as opposed to using the IRB is that you get syntax coloring and all the other wonderful NetBeans Ruby editing features.&lt;/p&gt;
&lt;img src="http://blogs.sun.com/divas/resource/editingJRuby.gif"&gt;
&lt;p&gt;To learn about the editing features, see the NetBeans &lt;a href="http://wiki.netbeans.org/wiki/view/RubyEditing"&gt;Ruby Editing&lt;/a&gt; wiki page, or look at Tor's &lt;i&gt;screenshot of the week&lt;/i&gt; entries, such as &lt;a href="http://blogs.sun.com/tor/entry/ruby_screenshot_of_the_week17"&gt;Ruby Screenshot of the Week #18: Errors and Snippets&lt;/a&gt; (as of today, he is up to &lt;a href="http://blogs.sun.com/tor/entry/extract_method_introduce_variable_introduce"&gt;
screenshot #23&lt;/a&gt;). We are also working on a &lt;a href="http://blogs.sun.com/divas/entry/ruby_getting_started_draft_available"&gt;
&lt;i&gt;getting started&lt;/i&gt;&lt;/a&gt; guide that will cover some of the editing features. Last, you can watch Roman's &lt;a href="http://www.netbeans.org/download/flash/jruby_editing/jruby_editing.html"&gt;
Editing screencast&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;There are a couple of FAQs that you might find helpful&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://wiki.netbeans.org/wiki/view/FaqHowToCallJavaFromRuby"&gt;
How to Call Java From Ruby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wiki.netbeans.org/wiki/view/FaqJRubyAndIRB"&gt;How Can I Access Java From the JRuby IRB?&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You also might want to check out the &lt;a href="http://wiki.netbeans.org/wiki/view/SwingJRuby"&gt;Swing with JRuby: Developing a Desktop Application with the JRuby and Java Swing APIs&lt;/a&gt; tutorial that was written by Sun campus ambassador &lt;a href="http://teera.seriyagroup.com/blog/index.php/2007/11/04/swing-jruby-netbeans-tutorial"&gt;Teera Kanokkanjanarat.&lt;/a&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/184461151" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/help_us_design_our_docs</id>
        <title type="html">Help Us Design Our Docs Pages</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/help_us_design_our_docs" />
        <published>2007-11-12T13:38:48-08:00</published>
        <updated>2007-11-12T13:38:48-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <content type="html">&lt;p&gt;We are redesigning the documentation lists and learning trails to include more than just written articles and tutorials. We are asking for your help in coming up with a design that works best for you. Below are links to four designs. Please take a look at each of the designs in terms of identifying the media type for a title.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://usersguide.netbeans.org/60trials/web_index_v4.html"&gt;
v4&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;
&lt;a href="http://usersguide.netbeans.org/60trials/web_index_v2.html"&gt;
v2&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;
&lt;a href="http://usersguide.netbeans.org/60trials/web_index_v3.html"&gt;
v3&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;
&lt;a href="http://usersguide.netbeans.org/60trials/web_index_v1.html"&gt;
v1&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Of the four, which page (v1, v2, v3, or v4) do you think makes it easiest to find what you are looking for in the desired media? Please briefly explain the benefits of that page and why you prefer it over the others.
&lt;/p&gt;&lt;p&gt;
Which page (v1, v2, v3, or v4) do you think is the worst for finding information in the desired media? Please briefly explain why you rate it last.
&lt;/p&gt;&lt;p&gt;
So as to not bias other people's opinions, please do not post your feedback as a comment. Instead, send your response to &lt;a href="mailto:nbdocsfeedback@emailias.com?subject=Doc%20Page%20Design%20Feedback"&gt;
nbdocsfeedback@emailias.com&lt;/a&gt;
&lt;/p&gt;&lt;p&gt;
Thank you very much for your time. Hopefully your input will make it easier to find the right docs at the right time.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/183889198" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/netbeans_ruby_shortcuts</id>
        <title type="html">NetBeans Ruby Shortcuts</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/netbeans_ruby_shortcuts" />
        <published>2007-11-07T11:16:18-08:00</published>
        <updated>2007-11-07T11:16:18-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="rails" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="ruby" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="shortcuts" scheme="http://rollerweblogger.org/ns/tags/" />
        <content type="html">&lt;p&gt;
The other day, Tor Norbye sent us an email listing some NetBeans Ruby navigation shortcuts, which we thought we'd highlight in the blog.  We did a little further research on the subject and also list here some favorite user shortcuts that we undercovered.
&lt;/p&gt;
&lt;p&gt;
(For a complete list of NetBeans Ruby Keyboard Shortcuts, see &lt;a href="http://wiki.netbeans.org/wiki/view/RubyShortcuts"&gt;Ruby Shortcuts&lt;/a&gt;).
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Navigation Shortcuts&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
Navigation is important - jumping between files and their tests, or between Rails actions and views. Here are some navigation shortcuts:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
If you're in a controller file, and realize you need to modify its corresponding view, press Ctrl-Shift-A (Command-Shift-A on the Mac) to jump to it.  Press again to go in the opposite direction.
&lt;/li&gt;
&lt;p&gt;&lt;li&gt;
Similarly, if you're in a Rails controller file (for example) and want to go edit its unit test, hit Ctrl-Shift-T (Command-Shift-T on the Mac) to jump to it - and again to jump back. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;b&gt;User Favorite Shortcuts&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Here are some more frequently used shortcuts.&lt;/p&gt;
&lt;table cellpadding="3"&gt;
&lt;tr&gt;
&lt;th align="left"&gt;Action&lt;/th&gt;
&lt;th align="left"&gt;Shortcut&lt;/th&gt;
&lt;th align="left"&gt;Mac Shortcut&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;Show code completion alternatives&lt;/td&gt;
&lt;td&gt;Ctrl-Space.
If Ctrl-Space does not work for your language, try using Ctrl-\&lt;/td&gt;
&lt;td valign="top"&gt;Ctrl-Space&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Open File by name prefix (not path)&lt;/td&gt;
&lt;td&gt;Alt-Shift-O&lt;/td&gt;
&lt;td&gt;Ctrl-Shift-O&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;Show name of current parameter (when editing an argument list for a method call)&lt;/td&gt;
&lt;td valign="top"&gt;Ctrl-P&lt;/td&gt;
&lt;td valign="top"&gt;Command-P&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
Format Code&lt;/td&gt;
&lt;td valign="top"&gt;Alt-Shift-F&lt;/td&gt;
&lt;td valign="top"&gt;Ctrl-Shift-F&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
Reformat the current comment paragraph&lt;/td&gt;
&lt;td valign="top"&gt;Ctrl-Shift-P&lt;/td&gt;
&lt;td valign="top" &gt;Command-Shift-P&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
Jump to matching parenthesis / brace / bracket, or other matching&lt;/td&gt;
&lt;td valign="top"&gt;Ctrl-[&lt;/td&gt;
&lt;td valign="top"&gt;Command-[&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;Show Documentation&lt;/td&gt;
&lt;td valign="top"&gt;Ctrl-Shift-Space&lt;/td&gt;
&lt;td valign="top"&gt;Command-Shift-Space&lt;/td&gt;
&lt;/table&gt;

&lt;p&gt;&lt;b&gt;NetBeans Shortcuts&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
You can download a shortcut card that lists the highlights of the NetBeans IDE 6.0 keyboard shortcuts and code templates.  In the NetBeans IDE, choose Help &gt; Keyboard Shortcuts Card from the main menu.  Similarly, you can view the shortcuts online from the &lt;a href="http://wiki.netbeans.org/wiki/view/KeymapProfileFor60"&gt; NetBeans IDE 6.0 Keyboard Shortcuts Specification&lt;/a&gt;.
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/181413253" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/confessions_of_a_netbeans_ruby</id>
        <title type="html">Confessions of a NetBeans Ruby User</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/confessions_of_a_netbeans_ruby" />
        <published>2007-11-02T09:02:12-07:00</published>
        <updated>2007-11-02T09:02:12-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="rails" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="ruby" scheme="http://rollerweblogger.org/ns/tags/" />
        <content type="html">&lt;p&gt;Teera Kanokkanjanarat is a Sun campus ambassador who
recently contributed the tutorial &lt;a href="http://wiki.netbeans.org/wiki/view/SwingJRuby"&gt;Swing with JRuby: Developing a 
Desktop Application with the JRuby and Java Swing APIs&lt;/a&gt;.  Here we interview Teera to find out more about his interest
in NetBeans Ruby.&lt;/p&gt;
&lt;b&gt;First, tell us a little bit about yourself.&lt;/b&gt;
&lt;p&gt;
I've been working as a freelance software developer for about 8 years ever since finishing high school. 
My work mainly focuses on the web platform with various technologies ranging from Java, ASP.NET, PHP, 
and recently I got started on Ruby and Rails. Since November 2006, I've been hired by Sun as a campus ambassador 
at Simon University in British Columbia, Vancouver, where I'm completing my degree in 
Computing Science and Business Administration. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;What is your interest in Ruby?&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Coming from the strongly-typed language world of Java and C#, 
I find the flexibility and dynamic of the Ruby language to be very interesting. 
I believe that the productivity of developers has a heavy impact on the cost of software projects. 
I often find that I waste time waiting for the project to compile and re-deploy to web or application servers. 
So that's the first thing I found really appealing when I started working with the Ruby and Rails framework. 
Ruby seems to gain a lot of momentum on the web platform with the Rails framework. Now I'm more interested in the 
future of Ruby as a rich client on the desktop. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;How did you learn Ruby?&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
I started out on Hal Fulton's &lt;em&gt;The Ruby Way&lt;/em&gt; book to learn the Ruby language itself and the Ruby way of doing things. 
I often watch screencasts and vodcasts for techniques on learning Rails. I'm also a member of the Vancouver Ruby and Rails 
user group, where I attend monthly meetings. This is an interesting group; as a Java guy, 
I learn so much from others who work with Ruby on a daily basis. &lt;/p&gt;

&lt;p&gt;&lt;b&gt;What do you like and dislike about Ruby?&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
The Ruby language itself is beautiful. There are not many programming languages that 
are as intuitive and give me that "wow this is cool stuff!" sort of thrill. Of course, this is also because of 
Ruby's coding conventions and key principles.
&lt;/p&gt;
&lt;p&gt;
I actually did a small experiment re-creating one of my old, small Java-based web projects with Ruby on Rails. 
I found that the entire project on RoR actually contains fewer lines of code than that in the previous version's configuration files!
&lt;/p&gt;
&lt;p&gt;
In my opinion, performance and deployment are still the key issues of Ruby. 
JRuby and other initiatives are really aiming on these two issues.
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;How has NetBeans helped you build Ruby apps?&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
I tried RadRails, TextMate, and InstantRails. Yet, I like Netbeans Ruby support the most, especially in code editing, 
the Ruby debugger, and the auto-complete capability. Netbeans is tightly integrated with JRuby as well.
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Tell us about the NetBeans Ruby app you are currently building?&lt;/b&gt;&lt;/p&gt;

I'm developing JSF web components for one of the my clients. There's future planning to release these 
components in rich client version (Swing and SWT). I'm doing an experimental project on how to leverage JRuby for developing these desktop components.

&lt;p&gt;&lt;b&gt;What was your favorite experience as a Sun ambassador?&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
Meeting with people! I made a lot of friends from around the world through this program. 
I also learned a lot from talking to people when I do evangelizing work, whether it's a tech demo or a 
presentation at a user group. Nothing beats learning from those who do real work out there in the field. 
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;What are some things you like to do outside school and work?&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
I started a small coffee shop back when I was 19 and opened up a day-spa with my sister about two years ago. 
Both of them are in Thailand. So, I'm helping my sister run them remotely.
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Where do you see yourself in five years?&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
Completing my degree is my first priority (it has been delayed several times due to my work). 
After finishing my term at Sun at the end of this year, I'll be joining Business Objects as a software developer. 
In the next five years, I might do another startup if there some good ideas come along, but things change, you never know.
&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/180110659" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/ruby_getting_started_draft_available</id>
        <title type="html">Ruby Getting Started Draft Available for Review</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/ruby_getting_started_draft_available" />
        <published>2007-10-30T18:00:43-07:00</published>
        <updated>2007-10-30T18:00:43-07:00</updated> 
        <category term="/AJAX" label="AJAX" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="rails" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="ruby" scheme="http://rollerweblogger.org/ns/tags/" />
        <content type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://blogs.sun.com/divas/resource/requirecomplete.png" &gt;
&lt;p&gt;We have posted a draft of the first 2 sections of the &lt;a href="http://www.netbeans.org/kb/60/ruby/getting-started.html"&gt;Getting Started With Ruby and Rails&lt;/a&gt; tutorial. If you can take some time to look it over
and give us feedback, please do.
&lt;/p&gt;
&lt;p&gt;
For those of you who are new to using the NetBeans Ruby support, we would like to know:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How is it so far for getting you started with using the product?
&lt;/li&gt;&lt;li&gt;Were the steps clear and complete? Did you stumble or have to try a step more than once to get it to work?
&lt;/li&gt;&lt;li&gt;Is it too much for introductory material? If so, what to remove. If not enough, what to include.
&lt;/li&gt;&lt;li&gt;Looking at the proposed table of contents, does it appear it will be complete? Too much?
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
For those of you who are experienced with Ruby, can you look for
incorrect terminology or misinformation? Are the code examples ok?
&lt;/p&gt;
&lt;p&gt;To provide feedback on this tutorial, please send corrections, suggestions, and comments to the  NetBeans Ruby Developers  mailing list at dev@ruby.netbeans.org. Put "Getting Started Draft Feedback" in the subject line.
&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/180110661" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/community_contributed_netbeans_ruby_documentation</id>
        <title type="html">Community-Contributed NetBeans Ruby Docs</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/community_contributed_netbeans_ruby_documentation" />
        <published>2007-10-29T11:06:26-07:00</published>
        <updated>2007-10-30T12:15:09-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="jruby" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="ruby" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="tutorials" scheme="http://rollerweblogger.org/ns/tags/" />
        <content type="html">&lt;p&gt;In this blog, we would like to acknowledge two NetBeans Ruby community-contributed tutorials: 
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://wiki.netbeans.org/wiki/view/SwingJRuby"&gt;Swing with JRuby: Developing a Desktop Application with the JRuby and Java Swing APIs&lt;/a&gt;
by Teera Kanokkanjanarat
&lt;/li&gt;  
&lt;li&gt;&lt;a href="http://wiki.netbeans.org/wiki/view/RubyonNetBeans6"&gt;Ruby Development on Netbeans 6&lt;/a&gt; by Amit Kumar Saha&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thanks to Teera and Amit, we have a richer documentation set, which you can view in its entirety on the &lt;a href="http://wiki.netbeans.org/wiki/view/RubyDocumentation"&gt;NetBeans Ruby Tutorials and Screencasts page&lt;/a&gt;.
&lt;p&gt;
If you are interested in contributing documentation to the NetBeans Community, consider joining the dev@userguide.netbeans.org email alias.  This alias is for community members who want to not only contribute documentation but also
provide input and feedback regarding existing NetBeans documentation.  You can sign up for the alias as follows:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go to the &lt;a href="http://usersguide.netbeans.org/servlets/ProjectMailingListList"&gt;NetBeans Mailing Lists Page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Log on with your user name. 
If you don't have a user name, click Login and then register for a login name.
&lt;/li&gt;
&lt;li&gt;Scroll to the dev@usersguide.netbeans.org mailing list.&lt;/li&gt;
&lt;li&gt;Click subscribe to send a subscription request.
&lt;/li&gt;
&lt;/ol&gt;


&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/180110663" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/got_ruby_questions</id>
        <title type="html">Got Ruby Questions?</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/got_ruby_questions" />
        <published>2007-10-19T10:30:10-07:00</published>
        <updated>2007-10-19T10:30:10-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="ruby" scheme="http://rollerweblogger.org/ns/tags/" />
        <content type="html">&lt;img align="left" border="2" hspace = "5" src="http://blogs.sun.com/divas/resource/IMG_3995.jpg"&gt;
&lt;p&gt;
Next week (October 22 - 26) you will have the opportunity to submit written questions about all things NetBeans to a team of NetBeans evangelists, including Ruby technology evangelist &lt;a href="http://weblogs.java.net/blog/bleonard/"&gt;Brian Leonard.&lt;/a&gt;. You can submit a question any time during that week, and the evangelists will try to answer as many questions as possible. They will also  post a selected set of questions and answers. To learn more, visit the &lt;a href="http://java.sun.com/developer/community/askxprt/"&gt;Ask the Experts&lt;/a&gt; events page.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/180110664" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/chart_for_netbeans_ruby_database</id>
        <title type="html">Chart for NetBeans Ruby Database Access Setup</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/chart_for_netbeans_ruby_database" />
        <published>2007-10-15T13:07:14-07:00</published>
        <updated>2007-12-17T18:22:12-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="database" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="jruby" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="rails" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="ruby" scheme="http://rollerweblogger.org/ns/tags/" />
        <content type="html">&lt;p&gt;I have written both an &lt;a href="http://www.netbeans.org/kb/60/ruby/setting-up.html"&gt;installation and configuration&lt;/a&gt; article and an &lt;a href="http://wiki.netbeans.org/wiki/view/FaqRailsDatabaseAccess"&gt;accessing databases&lt;/a&gt; FAQ for projects built using NetBeans Ruby support. However, because there are lots of different configuration paths, and each path requires some in-depth information, neither of these documents make it easy to quickly figure out what you must do to set up your Rails project to access your database server. I created this chart to hopefully make the steps simpler, and more clear. If you need more details, then consult the two documents that I mention above.&lt;/p&gt;
    &lt;table border="0" bgcolor = "#f5f8dd"  width="100%" &gt;
      &lt;tr &gt;
        &lt;th colspan="2" &gt;Steps for Accessing Databases Using NetBeans 
        Ruby Support&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&amp;nbsp;&lt;/td&gt;
        &lt;td&gt;
          &lt;table border="0" bgcolor="#cfc69b" width="100%"&gt;
            &lt;tr&gt;
              &lt;th align="left" colspan="2"&gt;
                Using JRuby
              &lt;/th&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td&gt;&amp;nbsp;&lt;/td&gt;
              &lt;td&gt;
                &lt;table border="0" bgcolor="#c9b473" width="100%"&gt;
                  &lt;tr&gt;
                    &lt;th align="left" colspan="2"&gt;
                      Using MySQL&lt;br&gt;
                    &lt;/th&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                    &lt;td&gt;
                      &lt;table border="0" bgcolor="#b9d7e2" width="100%"&gt;
                        &lt;tr&gt;
                          &lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
                          &lt;td&gt;
                            &lt;b&gt;Using JDBC&lt;/b&gt;&lt;br&gt;
                            Do:&amp;nbsp;&amp;nbsp;Put the MySQL JDBC 3.0 compliant &lt;a href="http://www.mysql.com/products/connector/j/"&gt;driver&lt;/a&gt; in netbeans-install-dir/ruby1/jruby-1.0.1/lib.&lt;br&gt;
                            Do:&amp;nbsp;&amp;nbsp;Select the database server from the drop-down list in the New Project wizard.&lt;br&gt;
                          Do:&amp;nbsp;&amp;nbsp;Select the Access Database Using JDBC checkbox in the New Project wizard.&lt;br&gt;&lt;/td&gt;
                        &lt;/tr&gt;
                      &lt;/table&gt;
                    &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                    &lt;td&gt;&lt;table border="0" bgcolor="#acacb4" width="100%"&gt;
                        &lt;tr&gt;
                          &lt;td&gt;&amp;nbsp;&lt;td&gt;
                          &lt;td&gt;
                            &lt;b&gt;Using the Bundled MySQL Adapter&lt;/b&gt;
                            &lt;br&gt;
                            Do:&amp;nbsp;&amp;nbsp;Select the database server from the drop-down list in the New Project wizard.&lt;br&gt;
                            Do:&amp;nbsp;&amp;nbsp;Clear the Access Database Using JDBC checkbox in the New Project wizard.&lt;br&gt;
                            
                    &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                &lt;/table&gt;    
              &lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              
              &lt;td&gt;&amp;nbsp;&lt;/td&gt;
              &lt;td&gt;
                &lt;table border="0" bgcolor="#94ad85" width="100%"&gt;
                  &lt;tr&gt;
                    &lt;th align="left" colspan="2"&gt;
                      Not Using MySQL&lt;br&gt;
                    &lt;/th&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                    &lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
                    &lt;td&gt;
                      Do:&amp;nbsp;&amp;nbsp;Put 
                      database's JDBC 3.0 compliant driver 
                      in 
                      &lt;i&gt;netbeans-install-dir&lt;/i&gt;/ruby1/jruby-1.0.1/lib&lt;br&gt;
                      Do: Select 
                      the database server from the drop-down list in 
                      the New Project wizard.&lt;br&gt;
                      Do: Select the 
                      Access Database Using JDBC checkbox in the New 
                      Project wizard.&lt;br&gt;
                      &lt;b&gt;Notes:&lt;/b&gt;
                      Currently, 
                      the supported databases are: MySQL, 
                      PostgresSQL, Oracle, HSQLDB, and Java DB 
                      (also known as Derby). The database's 
                      JDBC driver must be a pure Java driver.
                      If you are deploying to GlassFish, you must 
                      also put a copy of your database server's JDBC 
                      driver in &lt;i&gt;glassfish-install-dir&lt;/i&gt;/lib and 
                      start (or restart) the GlassFish server.&lt;br&gt;
                      &lt;br&gt;
                    &lt;/td&gt;
                  &lt;/tr&gt;
                &lt;/table&gt;                  
              &lt;/td&gt;
            &lt;/tr&gt;
          &lt;/table&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&amp;nbsp;&lt;/td&gt;
        &lt;td&gt;
          &lt;table border="0" bgcolor="#a5a196" width="100%"&gt;
            &lt;tr&gt;
              &lt;th align="left" colspan="2"&gt;
                Using Native Ruby
              &lt;/th&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td&gt;&amp;nbsp;&lt;/td&gt;
              &lt;td&gt;
                &lt;table border="0" bgcolor="#c9b473" width="100%"&gt;
                  &lt;tr&gt;
                    &lt;th align="left" colspan="2"&gt;
                      Using MySQL&lt;br&gt;
                    &lt;/th&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                    &lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
                    &lt;td&gt;
                      &lt;table border="0" bgcolor="#acacb4" width="100%"&gt;
                        &lt;tr&gt;
                          &lt;th align="left" colspan="2"&gt;
                            Using the Bundled MySQL Adapter&lt;br&gt;
                          &lt;/th&gt;
                        &lt;/tr&gt;
                        &lt;tr&gt;
                        &lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
                        &lt;td&gt;
                          Do:&amp;nbsp;&amp;nbsp;Select the database server from the 
                          drop-down list in the New Project wizard.&lt;br&gt;
                          Do:&amp;nbsp;&amp;nbsp;Clear the Access Database Using JDBC 
                          checkbox in the New Project wizard.
                        &lt;/td&gt;
                      &lt;/table&gt;
                    &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                    &lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
                    &lt;td&gt;
                      &lt;table border="0" bgcolor="#b5d6c5" width="100%"&gt;
                        &lt;tr&gt;
                          &lt;th align="left" colspan="2"&gt;
                            Using a MySQL Gem&lt;br&gt;
                          &lt;/th&gt;
                        &lt;/tr&gt;
                        &lt;tr&gt;
                          &lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
                          &lt;td&gt;
                            Do:&amp;nbsp;&amp;nbsp;Consult 
                            &lt;a href="http://wiki.rubyonrails.com/rails/pages/MySQL"&gt;
                            Ruby on Rails MySQL&lt;/a&gt; page. Download and 
                            install appropriate software.&lt;br&gt;
                            Do:&amp;nbsp;&amp;nbsp;Select the database server 
                            from the drop-down list in the New Project 
                            wizard.&lt;br&gt;
                            Do:&amp;nbsp;&amp;nbsp;Clear the Access Database 
                            Using JDBC checkbox in the New Project wizard.
                          &lt;/td&gt;
                        &lt;/tr&gt;
                      &lt;/table&gt;
                    &lt;/td&gt;
                  &lt;/tr&gt;
                &lt;/table&gt;
              &lt;/td&gt;
            &lt;/tr&gt;
            
            &lt;tr&gt;
              &lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
              &lt;td&gt;
                &lt;table border="0" bgcolor="#94ad85" width="100%"&gt;
                  &lt;tr&gt;
                    &lt;th align="left" colspan="2"&gt;
                      Not Using MySQL&lt;br&gt;
                    &lt;/th&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                  &lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
                  &lt;td&gt;
                    Do:&amp;nbsp;&amp;nbsp;Consult the 
                    &lt;a href="http://wiki.rubyonrails.org/rails/pages/DatabaseDrivers"&gt;
                    Ruby on Rails Database Drivers&lt;/a&gt; page. Download 
                    and install appropriate software.&lt;br&gt;
                    Do:&amp;nbsp;&amp;nbsp;Select the database server from 
                    the drop-down list in the New Project wizard.&lt;br&gt;
                    Do:&amp;nbsp;&amp;nbsp;Clear the Access Database Using JDBC
                    checkbox in the New Project wizard.
                    
                  &lt;/td&gt;
                &lt;/table&gt;
              &lt;/td&gt;
            &lt;/tr&gt;
            
          &lt;/table&gt;   
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th align="left" colspan="2"&gt;
          All&lt;br&gt;
        &lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
        &lt;td&gt;Do:&amp;nbsp;&amp;nbsp;Edit database.yml to 
          specify username, password, and, if 
          necessary, database name.
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/180110665" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/generating_rails_models</id>
        <title type="html">Generating Rails Models</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/generating_rails_models" />
        <published>2007-10-09T13:34:05-07:00</published>
        <updated>2007-10-09T13:34:05-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="models" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="rails" scheme="http://rollerweblogger.org/ns/tags/" />
        <content type="html">&lt;p&gt;Our NetBeans Ruby tutorials show how to use the Rails Generator dialog box to add models to a Ruby on Rails web application. We show one step that uses the Rails Generator wizard to create the following:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;Model File:&lt;/b&gt; This file contains the model's unique methods and business rules.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Initial Migration Files:&lt;/b&gt;  Migration file for creating the database table. You run the migration files to create and modify the database table, and to back out changes&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Unit Text Files:&lt;/b&gt; Files for testing your development.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the subsequent step we have you edit the migration file to specify the column names and types. Did you know that you can can create the model and edit the migration file in one step by passing arguments in the Rails Generator? For example, let's say that I wanted a &lt;i&gt;categories&lt;/i&gt; database table. I can right-click the project's node and choose &lt;b&gt;Generate&lt;/b&gt;. In the Rails Generator wizard, I choose &lt;b&gt;model&lt;/b&gt; from the &lt;b&gt;Generate&lt;/b&gt; drop-down list. Then, I enter the following text in the &lt;b&gt;Argument&lt;/b&gt; text box, and click &lt;b&gt;OK&lt;/b&gt; to create the files:&lt;/p&gt;

&lt;pre&gt;Category name:string description:text level:integer created:timestamp icon:binary&lt;/pre&gt;

&lt;p&gt;The arguments list begins with the model name and is followed by &lt;i&gt;column-name&lt;/i&gt;:&lt;i&gt;type&lt;/i&gt; parameters. The type can be one of 
&lt;tt&gt;:string, :text, :integer, :float, :decimal, :datetime, :timestamp, 
:time, :date, :binary, :boolean&lt;/tt&gt;. To learn more about model arguments, see the &lt;a href="http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/TableDefinition.html#M000805"&gt;TableDefinition&lt;/a&gt;  API.&lt;/p&gt;

&lt;p&gt;After the IDE finishes creating the files, I can click on the &lt;tt&gt;&lt;b&gt;create db/migrate/002_create_categories.rb&lt;/b&gt;&lt;/tt&gt; link in the Rails Generator tab in the &lt;b&gt;Output&lt;/b&gt; window to open the file in the editor. The contents looks like this:&lt;/p&gt;
&lt;table border=0 bgcolor="#AABDD2"&gt;
&lt;tr &gt;
&lt;td&gt;
&lt;pre&gt;
class CreateCategories &amp;lt; ActiveRecord::Migration
  def self.up
    create_table :categories do |t|
      t.column :name, :string
      t.column :description, :text
      t.column :level, :integer
      t.column :created, :timestamp
      t.column :icon, :binary
    end
  end

  def self.down
    drop_table :categories
  end
end
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;Once you have a migration file set up, you can move your application to another machine and have the IDE create the tables automatically. The same is true for database changes. With the up and down methods, you can quickly add or back out changes. Migrations also make it easier to switch to a different database server, say from JavaDB to MySQL.
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; If you have an existing database, and you want to quickly create migration files, right-click the project node and choose &lt;b&gt;Run Rake Task &amp;gt; db &amp;gt; schema &amp;gt; dump&lt;/b&gt;. The IDE writes the schema for your database to &lt;b&gt;Database Migration &amp;gt; schema.rb&lt;/b&gt;. You can copy the &lt;i&gt;create&lt;/i&gt; statements from the schema dump into migration files.
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/180110666" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/using_jmaki_1_0_with</id>
        <title type="html">Using jMaki 1.0 With NetBeans Ruby</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/using_jmaki_1_0_with" />
        <published>2007-09-26T12:01:06-07:00</published>
        <updated>2007-11-26T17:24:25-08:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="jmaki" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="jruby" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="rails" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="ruby" scheme="http://rollerweblogger.org/ns/tags/" />
        <content type="html">&lt;img align="left" src="http://blogs.sun.com/divas/resource/jmaki-seal.png"&gt;
&lt;p&gt;The &lt;a href="http://www.jmaki.com"&gt;jMaki 1.0 framework&lt;/a&gt;, with support for Java, PHP, and Ruby, was released yesterday. Last week, Arun Gupta posted a &lt;a href="http://blogs.sun.com/arungupta/entry/screencast_web8_jmaki_on_rails"&gt;screencast&lt;/a&gt; showing how to use jMaki wrappers of button and table widgets from Dojo and Yahoo frameworks in a Ruby on Rails application built using the NetBeans 6.0 Beta IDE.&lt;/p&gt;
&lt;img src="http://blogs.sun.com/divas/resource/jmakitables.png"&gt;
&lt;p&gt;With Arun's permission, I am supplying the steps to recreate a similar jMaki on Rails project. To save steps, I changed the order a bit. If you don't already have NetBeans Ruby Support, go to the &lt;a href="http://www.netbeans.org/kb/60/ruby/setting-up.html"&gt;Installing and Configuring Ruby Support&lt;/a&gt; tutorial for instructions.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Before you begin, create the database for this Rails application. You need a database server that is supported by JRuby, such as MySQL, Java DB, PostgresSQL, Oracle, or HSQLDB. Add a database instance named &lt;b&gt;rorjmakitables_development&lt;/b&gt;. For example, for MySQL, start the server and type the following at a command prompt.
&lt;pre&gt;mysqladmin -u root -p create rorjmakitables_development&lt;/pre&gt;
If you don't need a password, omit the &lt;b&gt;-p&lt;/b&gt;.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;
&lt;li&gt;If you haven't already, download the &lt;a href="https://ajax.dev.java.net/files/documents/3115/69449/org-netbeans-modules-sun-jmaki.nbm"&gt;jMaki NetBeans plugin&lt;/a&gt; (This is &lt;b&gt;org-netbeans-modules-sun-jmaki.nbm&lt;/b&gt;. The installer tells me it is version 1.6.11, and the info.xml in the NBM says its release date is Sept. 25, 2007).&lt;br&gt;&lt;br&gt;&lt;/li&gt;
&lt;li&gt;To install it into the IDE, complete the following steps:
&lt;br&gt;&lt;br&gt;
&lt;ol&gt;
&lt;li&gt;In the IDE, choose &lt;b&gt;Tools &amp;gt; Plugins&lt;/b&gt; from the main menu.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;
&lt;li&gt;Click the &lt;b&gt;Downloaded&lt;/b&gt; tab and click &lt;b&gt;Add Plugins&lt;/b&gt;.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;
&lt;li&gt;
Navigate to and select the downloaded &lt;b&gt;org-netbeans-modules-sun-jmaki.nbm&lt;/b&gt; module, then click &lt;b&gt;Open&lt;/b&gt;.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Install&lt;/b&gt;, and click &lt;b&gt;Next&lt;/b&gt;.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Select the radio button to accept the license agreement and click &lt;b&gt;Install&lt;/b&gt;.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Select &lt;b&gt;Restart IDE Now&lt;/b&gt; and click &lt;b&gt;Finish&lt;/b&gt;.
&lt;/li&gt;
&lt;/ol&gt;
&lt;br&gt;&lt;/li&gt;
&lt;li&gt;To create a new Ruby on Rails project, complete these steps:
&lt;br&gt;&lt;br&gt;
&lt;ol&gt;
&lt;li&gt;Right-click on a blank spot in the &lt;b&gt;Projects&lt;/b&gt; window, and choose &lt;b&gt;New Project&lt;/b&gt; from the pop-up menu.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Select &lt;b&gt;Ruby&lt;/b&gt; in the &lt;b&gt;Categories&lt;/b&gt; pane, select &lt;b&gt;Ruby on Rails Application&lt;/b&gt; in the &lt;b&gt;Projects&lt;/b&gt; pane and click &lt;b&gt;Next&lt;/b&gt;.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
If you have other Ruby installations in your path besides the bundled JRuby installation, you are asked to choose a Ruby interpreter. This dialog only pops up the first time the IDE needs to access the interpreter. For this tutorial, choose &lt;b&gt;JRuby&lt;/b&gt; and then click &lt;b&gt;Close&lt;/b&gt;. Note that this choice affects all Ruby projects. You can switch this setting whenever you want. See &lt;a href="http://www.netbeans.org/kb/60/ruby/setting-up.html"&gt;Installing and Configuring Ruby Support&lt;/a&gt; to learn how.
&lt;br&gt;&lt;br&gt;
If you have configured the IDE to not use JRuby, please use the Options wizard to switch back to JRuby for this tutorial, as described in &lt;a href="http://www.netbeans.org/kb/60/ruby/setting-up.html"&gt;Installing and Configuring Ruby Support&lt;/a&gt;.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Type &lt;b&gt;rorjmakitables&lt;/b&gt;, and accept the default location or, optionally, enter a different path.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Choose a &lt;b&gt;Database&lt;/b&gt; from the drop-down list. Your choice specifies how to set up the database.yml file. This tutorial uses &lt;b&gt;MySQL&lt;/b&gt;.
&lt;br&gt;&lt;br&gt;
At the time of this writing, Java DB is not on the list, but it probably will be added later.  So, if you are using the Java DB, and you don't see it on the list, don't bother selecting a database. You can edit the database.yml file instead.
See &lt;a href="http://www.netbeans.org/kb/60/ruby/setting-up.html#dbservers"&gt;Using Database Servers With JRuby&lt;/a&gt; for instructions.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
With JRuby, if you don't use MySQL, you must select the &lt;b&gt;Access Database Using JDBC checkbox&lt;/b&gt;. This causes the project to modify the environment.rb configuration file to use the ActiveRecord-JDBC gem. So, unless you are using MySQL, check this box.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Click &lt;b&gt;Next&lt;/b&gt;.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Because you are using the bundled JRuby, which includes Rails, the wizard shows that Rails is already installed. The wizard gives you the option of updating the installed version, but let's skip that.
&lt;br&gt;&lt;br&gt;
Click &lt;b&gt;Finish&lt;/b&gt;.
&lt;br&gt;&lt;br&gt;
The Generate Rails Project tab in the &lt;b&gt;Output&lt;/b&gt; window shows all the folders and files that the IDE creates.
&lt;/li&gt;
&lt;/ol&gt;
&lt;br&gt;&lt;/li&gt;&lt;li&gt;
The IDE opens the database.yml file in the editor. Set the &lt;b&gt;username&lt;/b&gt; for the &lt;b&gt;development&lt;/b&gt; configuration, as shown below. If your database requires a password, set the &lt;b&gt;password&lt;/b&gt; too.
&lt;pre&gt;
  development:
  adapter: mysql
  database: rorjmakitables_development
  username: root
  password: &lt;i&gt;root_password&lt;/i&gt;
  host: localhost
&lt;/pre&gt;
&lt;/li&gt;&lt;li&gt;
To add a controller, right-click the &lt;b&gt;rorjmakitables&lt;/b&gt; project node in the &lt;b&gt;Projects&lt;/b&gt; window, and choose &lt;b&gt;Generate&lt;/b&gt;. Select &lt;b&gt;controller&lt;/b&gt; from the &lt;b&gt;Generate&lt;/b&gt; drop-down list, set the &lt;b&gt;Name&lt;/b&gt; to &lt;b&gt;say&lt;/b&gt; and set the &lt;b&gt;View&lt;/b&gt; to &lt;b&gt;table&lt;/b&gt;, then click &lt;b&gt;OK&lt;/b&gt;.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
In the &lt;b&gt;Projects&lt;/b&gt; window, expand &lt;b&gt;Configuration&lt;/b&gt;
and double-click &lt;b&gt;routes.rb&lt;/b&gt; to open it in the editor.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Add the following line above all the other &lt;b&gt;map.connect&lt;/b&gt; entries.
&lt;pre&gt;
  map.connect '', :controller =&gt; 'say', :action=&gt;'table'
&lt;/pre&gt;
&lt;/li&gt;&lt;li&gt;
In the &lt;b&gt;Projects&lt;/b&gt; window, expand &lt;b&gt;Public&lt;/b&gt;,
right-click &lt;b&gt;index.html&lt;/b&gt; and choose &lt;b&gt;Delete&lt;/b&gt; (or 
Rename if you would rather rename the file).
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
In the &lt;b&gt;Projects&lt;/b&gt; window, expand &lt;b&gt;Views&lt;/b&gt;, expand &lt;b&gt;say&lt;/b&gt;, and double-click &lt;b&gt;table.rhtml&lt;/b&gt; to open it in the editor.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
On the right-side of the IDE is the &lt;b&gt;Palette&lt;/b&gt;, as shown below. Expand &lt;b&gt;jMaki Yahoo&lt;/b&gt;.
&lt;br&gt;&lt;br&gt;
&lt;img src = "http://blogs.sun.com/divas/resource/jMakiPalette.png"&gt;
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Drag a &lt;b&gt;Button&lt;/b&gt; widget from the jMaki Yahoo section and drop it on the file.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Drag and drop a second &lt;b&gt;Button&lt;/b&gt; widget.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Replace the widget code fragments with the following code.
&lt;pre&gt;
&amp;lt;%= jmaki_widget 'yahoo.button',
  :value =&amp;gt; { :label =&gt; 'Select 1',
  :action =&amp;gt; { :topic =&gt; '/jmaki/table/select',
    :message =&amp;gt; { :targetId =&amp;gt; '1' }
  }
} -%&amp;gt;
&amp;lt;%= jmaki_widget 'yahoo.button',
  :value =&amp;gt; { :label =&gt; 'Select 2',
  :action =&amp;gt; { :topic =&gt; '/jmaki/table/select',
    :message =&amp;gt; { :targetId =&gt; '2' }
  }
} -%&amp;gt;
&lt;/pre&gt;
These buttons use the jMaki &lt;i&gt;publish/subscribe&lt;/i&gt; mechanism to publish to the /jmaki/table/select topic, which you will program two table widgets to listen to. The table widgets will select either the first row or the second row, depending on which button is clicked. For more details on how to use publish/subscribe, see Carla Mott's &lt;a href="http://weblogs.java.net/blog/carlavmott/archive/2007/07/jmaki_widgets_t.html"&gt;Widgets Talking To Widgets&lt;/a&gt; blog entry.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;

Drag a &lt;b&gt;Data Table&lt;/b&gt; widget from the &lt;b&gt;jMaki Yahoo&lt;/b&gt; section onto the file.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Expand &lt;b&gt;jMaki Dojo&lt;/b&gt; and drag a &lt;b&gt;Table&lt;/b&gt; widget from that section onto the file.
&lt;br&gt;&lt;br&gt;Both these widgets use the &lt;a href="http://wiki.java.net/bin/view/Projects/jMakiTableDataModel"&gt;jMaki Table Data Model&lt;/a&gt;.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Add &lt;b&gt;:subscribe=&gt; "/jmaki/table",&lt;/b&gt; to each table widget, as shown in bold below, to make both tables listen to all the /jmaki/table topics. 
&lt;br&gt;&lt;br&gt; &lt;b&gt;(Important)&lt;/b&gt;Also, change the row data to include numeric ids, as shown in bold, so that they match the target ids in the button code. For the first row, you have to add &lt;b&gt;:id= &amp;gt; '1',&lt;/b&gt;. For the second row, which already has the &lt;b&gt;:id&lt;/b&gt; argument, simply change &lt;b&gt;bar&lt;/b&gt; to &lt;b&gt;2&lt;/b&gt;.
&lt;pre&gt;
&amp;lt;%= jmaki_widget 'yahoo.dataTable', &lt;b&gt;:subscribe=&gt; "/jmaki/table",&lt;/b&gt;
  :value =&amp;gt;
  {:columns =&amp;gt; [
    { :label =&amp;gt; 'Title', :id =&amp;gt; 'title'},
    { :label =&amp;gt; 'Author', :id =&amp;gt; 'author'},
    { :label =&amp;gt; 'ISBN', :id =&amp;gt; 'isbn'},
    { :label =&amp;gt; 'Description', :id =&amp;gt; 'description'}
  ],
  :rows =&gt; [
    { &lt;b&gt;:id=&amp;gt; '1',&lt;/b&gt; :title =&amp;gt; 'Book Title 1', 
          :author =&amp;gt; 'Author 1', :isbn =&amp;gt; '4412', 
          :description =&amp;gt; 'A Some long description'},
    { &lt;b&gt;:id =&amp;gt; '2',&lt;/b&gt; :title =&amp;gt; 'Book Title 2', 
          :author =&amp;gt; 'Author 2', :isbn =&amp;gt; '4412', 
          :description =&amp;gt; 'A Some long description'}
  ]
}
-%&amp;gt;
&amp;lt;%= jmaki_widget 'dojo.table', &lt;b&gt;:subscribe=&gt; "/jmaki/table",&lt;/b&gt;
  :value =&amp;gt;
  {:columns =&amp;gt; [
    { :label =&amp;gt; 'Title', :id =&gt; 'title'},
    { :label =&amp;gt; 'Author', :id =&gt; 'author'},
    { :label =&amp;gt; 'ISBN', :id =&gt; 'isbn'},
    { :label =&amp;gt; 'Description', :id =&gt; 'description'}
  ],
  :rows =&gt; [
    { &lt;b&gt;:id=&amp;gt; '1',&lt;/b&gt; :title =&amp;gt; 'Book Title 1', 
          :author =&amp;gt; 'Author 1', :isbn =&amp;gt; '4412', 
          :description =&amp;gt; 'A Some long description'},
    { :&lt;b&gt;id=&gt; '2',&lt;/b&gt; :title =&amp;gt; 'Book Title 2', 
          :author =&amp;gt; 'Author 2', :isbn =&amp;gt; '4412', 
          :description =&amp;gt; 'A Some long description'}
  ]
}
-%&amp;gt;
&lt;/pre&gt;
&lt;/li&gt;&lt;li&gt;
Click the &lt;b&gt;Run Main Project&lt;/b&gt; button on the main menu (the green arrow). This starts the server and opens the table view in a browser. 
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Click the first button to select the first row, and click the second button to select the second row.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
In order to display database data in the table, we must first create a model. In the &lt;b&gt;Projects&lt;/b&gt; window, right-click the project node, and choose &lt;b&gt;Generate&lt;/b&gt; from the pop-up menu.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Choose &lt;b&gt;model&lt;/b&gt; from the &lt;b&gt;Generate&lt;/b&gt; drop-down list, type &lt;b&gt;grid&lt;/b&gt; in the &lt;b&gt;Arugments&lt;/b&gt; text box, and click &lt;b&gt;OK&lt;/b&gt;.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
To define the model's data structure, expand &lt;b&gt;Data Migrations&lt;/b&gt; in the &lt;b&gt;Projects&lt;/b&gt; window, then expand &lt;b&gt;migrate&lt;/b&gt; and double-click &lt;b&gt;001_create_grids.rb&lt;/b&gt; to open it in the editor.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Replace the &lt;b&gt;up&lt;/b&gt; method with the code shown in bold.
&lt;pre&gt;
class &lt;i&gt;CreateGrids &amp;lt; ActiveRecord::Migration&lt;/i&gt;

 &lt;b&gt;def self.up
    create_table :grids do |t|
      t.column :title, :string
      t.column :author, :string
      t.column :isbn, :string
      t.column :description, :string
    end
    &lt;i&gt;Grid&lt;/i&gt;.create(:title=&amp;gt; 'Marathon',
       :author=&amp;gt; 'Jeff Galloway',
       :isbn=&amp;gt; '0936070250',
       :description =&amp;gt; 'A running book for everybody');   
    &lt;i&gt;Grid&lt;/i&gt;.create(:title=&amp;gt; 'The Runners Bible',
       :author=&amp;gt; 'Marc Bloom',
       :isbn=&amp;gt; '0385188749',
       :description =&amp;gt; 'How to train, race, and get in shape');   
  end&lt;/b&gt;

  def self.down
    drop_table :grids
  end
end
&lt;/pre&gt;
&lt;/li&gt;&lt;li&gt;
To create the database table and populate it with the two rows of data, right-click the project node in the &lt;b&gt;Projects&lt;/b&gt; window and choose &lt;b&gt;Migrate Database &amp;gt; To Current Version&lt;/b&gt; from the pop-up menu.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Now you can
define a variable that contains the data from the database table. In the &lt;b&gt;Projects&lt;/b&gt; window, expand &lt;b&gt;Controllers&lt;/b&gt; and double-click &lt;b&gt;say_controller.rb&lt;/b&gt; to open it in the editor.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Replace the &lt;b&gt;table&lt;/b&gt; definition with the following code shown in bold.
&lt;pre&gt;
class &lt;i&gt;SayController  &amp;lt; ApplicationController&lt;/i&gt;

  def index
    table
    render :action =&amp;gt; 'table'
  end
 &lt;b&gt;def table
    @rows_data = []
    &lt;i&gt;Grid&lt;/i&gt;.find_all().each do |data|
      @rows_data  &amp;lt;&amp;lt; { :id =&amp;gt; data.id,
        :title =&amp;gt; data.title,
        :author =&amp;gt; data.author,
        :isbn =&amp;gt; data.isbn,
        :description =&amp;gt; data.description
      }
    end
  end&lt;/b&gt;
end
&lt;/pre&gt;
The above code defines the rows_data variable and initializes it to an empty array. It uses the active record to find all the rows from the database and, for each row, add a hash of the fields to the rows_data array.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Return to the &lt;b&gt;table.rhtml&lt;/b&gt; view by right-clicking in the editor and choosing &lt;b&gt;Navigate &amp;gt; Go To Rails Action or View&lt;/b&gt;.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Replace the static rows data in the table fragments with the @rows_data variable as shown in bold below.
&lt;pre&gt;
&amp;lt;%= jmaki_widget 'dojo.table',
:value =&amp;gt;
{:columns =&amp;gt; [
     { :label =&amp;gt; 'Title', :id =&amp;gt; 'title'},
     { :label =&amp;gt;'Author', :id =&amp;gt; 'author'},
     { :label =&amp;gt; 'ISBN', :id =&amp;gt; 'isbn'},
     { :label =&amp;gt; 'Description', :id =&amp;gt; 'description'}
     ],
  &lt;b&gt;:rows =&amp;gt; @rows_data&lt;/b&gt;
  }
-%&amp;gt;
&amp;lt;%= jmaki_widget 'yahoo.dataTable',
:value =&amp;gt;
{:columns =&amp;gt; [
     { :label =&amp;gt; 'Title', :id =&amp;gt; 'title'},
     { :label =&amp;gt; 'Author', :id =&amp;gt; 'author'},
     { :label =&amp;gt; 'ISBN', :id =&amp;gt; 'isbn'},
     { :label =&amp;gt; 'Description', :id =&amp;gt; 'description'}
     ],
  &lt;b&gt;:rows =&amp;gt; @rows_data&lt;/b&gt;
  }
-%&amp;gt;
&lt;/pre&gt;
&lt;/li&gt;&lt;li&gt;
Choose &lt;b&gt;File &amp;gt; Save All&lt;/b&gt; from the main menu to save all your changes.
&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;
Go back to the browser and refresh the page. The data now comes from the database table.
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
There you have it! To learn more about jMaki, go to &lt;a href="http://www.jmaki.com"&gt;www.jmaki.com&lt;/a&gt;. To learn more about NetBeans support for Ruby, go to &lt;a href="http://wiki.netbeans.org/wiki/view/Ruby"&gt;wiki.netbeans.org/wiki/view/Ruby&lt;/a&gt;. 
&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/180110667" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/installing_and_configuring_netbeans_ruby</id>
        <title type="html">Installing and Configuring NetBeans Ruby</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/installing_and_configuring_netbeans_ruby" />
        <published>2007-09-20T11:17:59-07:00</published>
        <updated>2007-09-20T11:17:59-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="ruby" scheme="http://rollerweblogger.org/ns/tags/" />
        <content type="html">&lt;p&gt;
Netbeans Beta 1 was released Monday, and you can download a version of the IDE that contains Ruby support from the &lt;a href="http://bits.netbeans.org/download/6_0/beta1/latest/"&gt;NetBeans IDE 6.0 Download Page&lt;/a&gt;.  A good resource to help you get started is the new tutorial &lt;a href="http://www.netbeans.org/kb/60/ruby/setting-up.html"&gt;Installing and Configuring Ruby Support&lt;/a&gt;.  This tutorial provides everything you need to know from downloading, installing, and configuring Ruby support, to working with databases, to deploying a JRuby application to Glassfish.
&lt;/p&gt;
&lt;p&gt;
If you are creating Ruby on Rails applications, we have another new tutorial in that area, 
&lt;a href="http://www.netbeans.org/kb/60/ruby/model.html"&gt;Building Relationships Between Rails Models&lt;/a&gt;.  This tutorials enhances the 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; by enabling readers to add comments to a blog post.  In particular, the new tutorial describes how to create a one-to-one and a one-to-many relationship between models in a NetBeans Ruby on Rails project.
&lt;/p&gt;
&lt;p&gt;
If you are interested in contributing to NetBeans Ruby, please consider joining the Ruby mailing lists:
&lt;a href="mailto:dev@ruby.netbeans.org"&gt;dev@ruby.netbeans.org&lt;/a&gt;, used to discuss development of the Ruby features for NetBeans, and 
&lt;a href="mailto:users@ruby.netbeans.org"&gt;users@ruby.netbeans.org&lt;/a&gt;, for general support and discussions of NetBeans Ruby.  To subscribe to and participate in the aliases, please visit the &lt;a href="http://ruby.netbeans.org/servlets/ProjectMailingListList"&gt;Mailing List&lt;/a&gt; page. 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/InsiderScoopFromTheTutorialDivas/~4/180110668" height="1" width="1"/&gt;</content>
    </entry>
    <entry>
        <id>http://blogs.sun.com/divas/entry/arun_pushes_the_edge_of</id>
        <title type="html">Arun Pushes the Edge of the JRuby/GlassFish Envelope</title>
        <author><name>divas</name></author>
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/divas/entry/arun_pushes_the_edge_of" />
        <published>2007-09-17T15:57:28-07:00</published>
        <updated>2007-09-17T15:57:28-07:00</updated> 
        <category term="/Ruby" label="Ruby" />
        <category term="glassfish" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="jruby" scheme="http://rollerweblogger.org/ns/tags/" />
     