A template enables the view to dynamically generate the response's body by combining dynamic values, like instance variables and the flash object, and static content like HTML tags and text. Throughout this book you've been exposed to ERb templates as a means of generating XHTML documents. Yet ERb is not limited to this task and can be used to generate any other type of document that requires a mix of static and dynamic content (that is, Ruby code).
Note that for historical reasons, the old extension format is still accepted. If you work with legacy code, you may find the equivalent myfile.rhtml, myfile.rxml, and myfile.rjs. As you upgrade an existing project to Rails 2.2 or a newer version, you can safely rename them.
ASP.NET developers are used to thinking in terms of controls that are positioned within a page. In ERb templates, the approach is entirely different. In fact, most templates contain ...