0%

Book Description

RJS templates are an exciting and powerful new type of template added to Rails 1.1. Unlike conventional Rails templates that generate HTML or XML, RJS templates generate JavaScript code that is executed when it is returned to the browser. This JavaScript generation allows you to perform multiple page updates in-place without a page reload using Ajax. All the JavaScript you need is generated from simple templates written in Ruby. This document helps you get acquainted with how RJS templates fit into the Rails framework and gets you started with a few easy-to-follow examples.

Table of Contents

  1. RJS Templates for Rails
    1. Introduction
      1. What Is RJS?
      2. Who Should Read this Document?
      3. Rails Version
      4. Acknowledgments
    2. Getting Started with a Simple Application
    3. RJS and Rails
      1. Debugging
        1. Development Mode Debugging
        2. Monitoring the Logfile
      2. ActionController
        1. Default View
        2. Layouts
        3. Rendering
        4. Inline Rendering
        5. Browser Redirection
      3. ActionView
        1. Element, Class, and Collection Proxies
          1. Element Proxies
          2. Class Proxies
          3. Collection Proxies
        2. Making Ajax Calls with Rails
      4. Helpers
    4. RJS in Practice: The Expense Tracker
      1. Creating the Models
      2. Defining the Controllers
      3. Setting Up a Route
      4. Creating an Application Layout
      5. Entering Some Data
      6. Creating the Views
      7. What We Have So Far
    5. FireBug: Awesome JavaScript Utility
      1. What Is FireBug?
      2. Installation
      3. A Brief Tour
    6. Enhancing the Expense Tracker
      1. Ajax Activity Indicator
      2. Ajax Global Responders
      3. Model Validations
      4. Adding Some Calculations
      5. Refactoring with RJS Helpers
      6. A Look Ahead
    7. RJS Reference
      1. JavaScriptGenerator
      2. JavaScriptElementProxy
      3. JavaScriptCollectionProxy
        1. Block Variables and the Enumerable methods
        2. Inspecting the Results of the Enumerations
        3. Method Reference
      4. Visual Effects
    8. Appendix
      1. Bibliography
      2. Online Resources
        1. Prototype
        2. Scriptaculous
        3. RJS
        4. Ruby on Rails
3.16.76.227