Sha256: 1f6c495399018cc67e9c3b4f1a9fa35de72db2daff98a0fb9ae30c739b13e71b

Contents?: true

Size: 1.4 KB

Versions: 3

Compression:

Stored size: 1.4 KB

Contents

012345678901234567890123456789012345678901234567890123456789012345678901
ruby hw.rb -r webrick

This example introduces is the use of a form, capturing form data, and
passing control and data to another component.

One of the things about IOWA that makes application development very
easy is that is provides implicit sessions, and it takes care of all
of the details involved moving data to and from forms and making it
transparently accessible to the code.

In this example, the Form is given an oid that represents the default
method to call when the form is submitted (if a submit button is no
pressed).  The Input is also given an oid.  The oid contains the
accessor to use to get/set the input field value.  Finally there is
an Input tag with a type of submit.  The oid, as with the Form tag,
contains the method to call when the button is pressed.

When execution moves to the got_name() method in the controller,
IOWA will have made sure that the value in the form has been placed
into the @yourname variable.

The got_name method calls page_named to return a new instance of a
component, Greetings.  It assigns the @yourname variable that came
from the form to an accessor in the Greetings object, and then yields
the object.  When an action yields another component, that component
is passed control of the request/response cycle; the response that is
passed back to the browser will be generated by the yielded component.

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
IOWA-1.0.3 examples/hw4/iowa/README
IOWA-1.0.2 examples/hw4/iowa/README
IOWA-1.0.0 examples/hw4/iowa/README