Creating a New View

A view defines the user interface, which can be simple HTML or can also have dynamic content. Rails uses templates to generate dynamic content. There are three types of dynamic-content templates: rhtml includes Ruby code with the html, rxml uses Ruby code to construct XML, and rjs supports JavaScript. 3rdRail provides specific wizards and editors for these file types.

A layout is a template defining the standard page elements used by a view.

Use the following steps to create a new RHTML file using the RHTML Wizard.

Open the RHTML File Wizard:

  1. From the workbench select RHTML File Wizard New Rails Project Wizard
    From the workbench select: File | New | RHTML file.
  2. Choose the directory and name the file.
    Click Next to choose from an existing template.
  3. Click Finish to open the new file in the .rhtml Editor.

Corporate LogoCodeGear brand and product names are service marks, trademarks or registered trademarks of Borland Software Corporation in the United States and other countries.