Skip to main content

If you don't have an IBM ID and password, register here.

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. This profile includes the first name, last name, and display name you identified when you registered with developerWorks. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

Ruby on Rails and J2EE: Is there room for both?

Two Web application frameworks compared

Return to article


Listing 2. order_controller.rb
01  class OrderController < ActionController::Base
02    def list
03      @orders = Order.find_all            // Find all orders and set instance variable
04                                          // framework automatically forwards to list.rhtml
05    end
06
07    def delete
08      id = @params["id"]                  // Get the order id from the request
09      Order.delete(id)                    // Delete the order
10      redirect_to :action => "list"       // Forward to the list action (list method)
11    end
12  end

Return to article