13.1. Background13.1.1. The Limitations and Benefits of Our Approach13.1.2. Pros and Cons of the Frameworks Covered13.1.3. Merb: The Missing Framework13.2. Rails: Ruby's Killer App13.2.1. What Is Rails and Why Use It?13.2.2. Installing Rails13.2.2.1. Database Considerations13.2.3. Building a Basic Rails Application13.2.3.1. Creating a Blank Rails Application13.2.3.1.1. The rails Command-Line Tool13.2.3.2. Files and Directories Within a Rails Application13.2.3.3. Database Configuration13.2.3.4. Using Scaffolding13.2.3.5. Database Migrations13.2.3.6. Running the Basic, Scaffolded App13.2.4. Controllers and Views13.2.4.1. Controller Actions13.2.4.2. Views and Embedded Ruby (ERB)13.2.4.3. Creating a New Action and View13.2.5. Models and Relationships13.2.6. Sessions and Filters13.2.7. Other Features13.2.7.1. Layouts13.2.7.2. Testing13.2.7.3. Plugins13.2.8. Where to Go Next: References, Books, and Example Apps13.2.8.1. Reference Sites and Tutorials13.2.8.2. Rails Books13.2.8.3. Open Source Rails Applications13.3. Sinatra: The Framework for Lightweight, Simple Web Applications13.3.1. The Extreme Simplicity of Sinatra13.3.2. General URL Routing and Parameter Matching13.3.3. Views, Templates, and Static Files13.3.3.1. Inline and In-File Templates13.3.3.2. Layouts13.3.3.3. External Templates and Layouts13.3.3.4. Static Files13.3.4. Request Flow Control13.3.4.1. Redirection13.3.4.2. Halting13.3.4.3. Error Handling13.3.5. Further Resources13.4. Ramaze: A Lightweight, MVC-Focused Web Application Framework13.4.1. Generating a Bare Ramaze App13.4.2. Application Structure and Customization13.4.2.1. Key Files and Loading Strategy13.4.2.2. Controllers13.4.2.2.1. The Main Controller13.4.2.2.2. Creating a Controller13.4.2.2.3. Parameters13.4.2.3. Templates and Views13.4.2.3.1. Template Engines and Ezamar13.4.2.3.2. Views for Controller Methods13.4.2.3.3. Passing Data from Controllers to Views13.4.2.4. Models13.4.2.4.1. Creating a Basic Model13.4.2.4.2. Using ActiveRecord with Ramaze13.4.3. Single-File Applications13.4.4. Further Resources13.5. Summary