Oracle GlassFish Server 3.0.1 Scripting Framework Guide

ProcedureTo Create the Controller and the View

The next step in creating and deploying the hello application is to create an application controller and a default application view.

  1. Change to the directory in which you created the hello application in To Create the hello Application.

    In this example:

    cd /apps/jruby-apps/hello
  2. Create a controller and default view for your application:

    jruby script/generate controller home index

    You should see a controller file called home_controller.rb in the hello/app/controllers directory, and a view file called index.html.erb in the hello/app/views directory.

  3. Proceed with the instructions in To Pass Data From the Controller to the View.