Rails Pocket Reference

Book description

Rails 2.1 brings a new level of stability and power to thisacclaimed web development framework, but keeping track of itsnumerous moving parts is still a chore. Rails PocketReference offers you a painless alternative to hunting forresources online, with brief yet thorough explanations of the mostfrequently used methods and structures supported by Rails 2.1,along with key concepts you need to work through the framework'smost tangled corners.Organized to help you quickly find what you need, this book willnot only get you up to speed on how Rails works, it also provides ahandy reference you can use anywhere, anytime. Inside, you'll findessential information on how to:

  • Install Rails with RubyGems

  • Build, compile, and process files with Rake

  • Test Rails applications using assertions and fixtures

  • Use Rails with Ajax

  • Connect objects to a database using ActiveRecord

  • Make web requests with the Action Controller framework

  • Use REST web service APIs

  • And much more. Save yourself hours of frustration: If you useRails daily and just want the facts -- fast -- this is yourbook.

    Publisher resources

    View/Submit Errata

    Table of contents

    1. Preface
      1. Conventions Used in This Book
      2. Using Code Examples
      3. Safari® Books Online
      4. How to Contact Us
      5. Acknowledgments
    2. 1. Rails Pocket Reference
      1. About Rails Pocket Reference
      2. Getting Started
      3. RubyGems
        1. Installing Rails with RubyGems
          1. Using Instant Rails on Windows
        2. Gem Dependencies
      4. Rails Commands and Configuration
        1. Usage and Options
          1. Usage
          2. Options
        2. Rails File Structure
        3. Configuring Rails
        4. Scripts
      5. Environments
        1. Configuring Your Environment
          1. General options
          2. ActiveRecord options
          3. ActionView options
          4. ActionMailer options
        2. Custom Environments
      6. Rake
        1. Usage and Options
        2. Building Custom Rake Tasks
      7. Testing Rails
        1. Assertions
          1.  
        2. Functional Tests
          1. Controller-driven functional tests
          2. View-driven functional tests
        3. Fixtures
          1. YAML
          2. Comma-separated value
          3. ERb in YAML and CSV
        4. Mocks
        5. Unit Testing for Models
      8. Rails Console
        1. Console Tips and Tricks
          1. Accessing the last return value with _
          2. Run the console in sandbox mode
          3. Output object to YAML with y
          4. Format with helper methods using helper
          5. Access your controllers with app
      9. ActiveRecord and Models
        1. Migrations
          1. Column type mappings
          2. Column options
          3. Run the migration
        2. Associations
          1. One-to-one
          2. One-to-many
          3. Many-to-many
          4. Polymorphic associations
        3. Validations
        4. Named Scope
          1. Passing arguments
          2. Named scope extensions
          3. Anonymous scopes
        5. CRUD: Create, Read, Update, Delete
          1. Create
          2. Read
          3. Update
          4. Delete
          5. Conditions
          6. Dirty objects
          7. Partial updates
        6. Database Configurations
          1. MySQL
          2. PostgreSQL
          3. Oracle
          4. Microsoft SQL Server
        7. Using Multiple Database Configurations
      10. Action Controllers
        1. Requests
        2. Parameters
        3. Sessions
        4. Responses
        5. Renders
        6. Redirects
        7. Calling Multiple Redirects or Renders
      11. Views
        1. Using Variables with ERb
        2. Layouts and Templates
          1. respond_to
          2. Using custom formats with respond_to
          3. Builder
          4. JavaScriptGenerator
          5. Using subtemplates
        3. Partials
          1. Rendering a collection of partials
          2. Rendering shared partials
          3. Rendering partials with layouts
        4. Caching
          1. Page caching
            1. Setting the cache directory
            2. Setting the cache extension
            3. Methods
          2. Action caching
          3. Fragment caching
            1. Fragment stores
          4. Sweeping cache
      12. Rails and Ajax
        1. JavaScriptHelper
        2. PrototypeHelper
        3. ScriptaculousHelper
        4. Real World Example: Honey-Do Task List
      13. Routing
        1. Routing Basics
          1. Route priority
          2. Default routes and default parameters
          3. Named routes
          4. Pretty URLs
          5. Regular expressions and parameters
          6. Route globbing
          7. Route conditions
          8. Reloading routes
      14. REST
        1. RESTful Resources
        2. Sample RESTful Rails Application
      15. ActionMailer
        1. Sending an Email
        2. HTML and Multipart Emails
        3. Attachments
      16. Action Web Services
        1. What Can You Do with Web Services Under Rails?
        2. Using REST
        3. Using XML-RPC
        4. Using SOAP
      17. Logging
        1. Filtering Sensitive Parameters
        2. Creating Additional Loggers
        3. Logging on the Console
      18. ActiveResource
      19. Plugins
      20. Capistrano
      21. TextMate
      22. Helpers
        1. ActiveRecordHelper
        2. AssetTagHelper
        3. CacheHelper
        4. DateHelper
        5. FormHelper
        6. FormOptionsHelper
        7. NumberHelper
    3. Index
    4. About the Author
    5. Copyright

    Product information

    • Title: Rails Pocket Reference
    • Author(s): Eric Berry
    • Release date: September 2008
    • Publisher(s): O'Reilly Media, Inc.
    • ISBN: 9780596520700