Ruby on Rails Enterprise Application Development: Plan, Program, Extend Table of Contents

Back to BOOK PAGE

Table of Contents

Preface
Chapter 1: Introduction
Chapter 2: The Initial Problem
Chapter 3: Laying the Foundations
Chapter 4: Working with Rails
Chapter 5: Building the User Interface
Chapter 6: Into Production
Chapter 7: Improving the User Experience
Chapter 8: Extending the Application
Chapter 9: Advanced Deployment
Chapter 10: Down the Track
Appendix A: Running Your Own Gem Server
Index

  • Chapter 1: Introduction
    • Why this Book?
    • Why Develop?
    • Why a Client/Server Based Web Application?
    • But why Ruby on Rails?
      • Rails Handles Menial Tasks
      • Clear Code
      • Text Based File
      • Open Source
      • Plentiful Documentation
      • Built-in Safe Test Environment
    • Ruby on Rails in Detail
    • Summary
  • Chapter 2: The Initial Problem
    • A Normal Day in the Office
    • Examining the Data
    • Data Objects
      • Database Table Design Rules
    • Separating the Data
    • Naming Conventions
      • Use Meaningful Names
      • Use a Consistent Naming Convention
      • Ruby on Rails Naming Conventions
        • Constants and Classes
        • Variables
        • Methods and Properties
        • Special Method and Property Suffixes
        • Reserved Words
    • Back to the Data
    • Review the Result
      • Project Preparation Steps
    • How Good is the Source Data?
    • Tracking Who does What
      • No Log-On and No Authentication
      • Simple Password Access
      • User Log-On
      • Recording Access History
      • Access Control for Rory's Application
    • Data Validation
      • The Minimum Required Data is Entered
      • Each Record can be Uniquely Identified
      • Identify Fields that Need to Have a Particular Format
      • References to Data in Other Tables Point to Actual Data
    • Rory's Data
      • Person
      • Company
      • Address
    • Summary
  • Chapter 3: Laying the Foundations
    • Supporting Rails Development
    • Addressing the Challenges
    • Setting Up a Rails Stack
      • Installing a Rails Stack Using a Bundle
    • Installing a Custom Rails Stack
      • Installing Ruby and Rubygems
        • Ruby on Windows
        • Ruby on Linux
        • Ruby on Mac OS X
      • Installing Rails
        • A Note on Rails Documentation
      • Other Libraries
        • Capistrano for Easier Deployment
        • Mongrel: A Better Way to Run Rails Applications
      • Choosing a Database Platform
        • Installing MySQL
        • Checking Your MySQL Installation
        • MySQL GUI Tools
        • Ruby-MySQL: Making Ruby and MySQL Work Better Together
      • Installing an IDE
        • Eclipse
        • EasyEclipse
      • Instructions for Masochists
      • In the Back Rooms at Acme…
    • Setting Up a Team Server
      • Quick Gem Installation
    • Remote Access via SSH
      • Adding Users
    • Version Control with Subversion
      • Subversion Standard Practices
      • Setting Up a Subversion Repository
      • Setting Up a Project in Subversion
      • Browsing Subversion from Eclipse
      • Other Subversion Clients
    • Using Other People's Servers
    • Back at Acme
  • Summary
  • Chapter 4: Working with Rails
    • The World According to Rails
      • Model-View-Controller Architecture
      • Convention over Configuration
        • Rails and MVC
    • Setting Up a New Rails Application
      • Using Mongrel to Serve Your Application
    • Connecting Rails to a Database
      • Creating a Database and System Account
      • Setting Up a Database Connection
        • Configuring the Rails Environments
        • Testing the Database Connection
        • Troubleshooting a MySQL Connection
    • ActiveRecord, Migrations, and Models
      • Model == Table
      • Which Comes First: The Model or The Table?
      • Building a Model with Migrations
        • Converting a Data Structure into a Migration
        • Defining Columns in Migrations
        • Other Operations Available in a Migration
      • Running a Migration
      • Rolling Back to a Previous Version of the Database
    • The Scaffold
    • Completing the Database
      • The companies Table
      • The addresses Table
      • Generating the Remaining Tables
    • Models in Detail
      • Creating New Records in a Table via Models
      • Finders
        • Finding All of the Records in a Table
        • Virtual Attributes
        • Sorting Records
        • Finding a Single Record
        • Finding Records Matching Search Criteria
        • Finding Records Using Attribute-Based Finders
        • Finding Records by Raw SQL
        • Writing a Custom Finder
        • Viewing the SQL
        • Viewing Logs in Eclipse
      • Validation
        • Validating People
        • Validating Companies
        • Validating Addresses
        • Other Types of Validation
      • Testing
        • Setting Up for Testing
        • Anatomy of a Test Case
        • What Should be Tested?
        • Fixtures
        • Tests for the Person Model
        • Other Types of Assertion
        • Becoming Driven by Testing
      • Associations between Models
        • Parent to children (one-to-many): addresses to people
        • Parent to child (one-to-one): addresses to companies
        • Parent to children (one-to-many): companies to people
        • Many-to-many relationships
        • Dependencies
        • Testing Associations
    • Putting the Project into Context
      • Storing a Project in Subversion
        • Ignoring Temporary Files
        • Committing Code to the Repository
      • Processing Data
        • Exporting the Data from Outlook
        • Mapping a Text File to Database Tables
        • Coding the Script
    • Summary
  • Chapter 5: Building the User Interface
    • Controllers and Views: A Recap
    • Creating a Simple Controller and Its Views
      • Views and Layouts
        • Adding a View to the Application
        • Displaying Model Instances in a View
        • Pagination
        • Linking to Another View
        • Adding a Layout
        • Adding a Stylesheet
    • Adding a Controller for Companies
      • Create the CompaniesController
      • Create the Index View
      • Test It!
      • Summary
    • Advanced View Techniques
      • Custom Helpers
        • Default Messages for Empty Fields
        • Date Formatting
      • Showing Associated Records
        • Refining Using a Helper
        • Showing an Address with a Partial
      • Rendering Pagination Links with a Partial
      • Adding a Menu
    • C*UD (Create, Update, Delete)
      • Creating a Person
        • Refining with a Helper
        • Validation Errors
        • The Flash
        • Finishing Touches
      • Updating a Person
      • Opportunities for Refactoring
        • Using Filters
        • Creating Application-Level Controller Methods
      • Deleting a Person
      • Adding Edit and Delete Links to a Person's Profile
    • Editing Multiple Models Simultaneously
      • Adding a New Address for a Person
        • Using Functional Testing for Complex Actions
      • Updating a Person and Their Address
      • Summary
    • Fleshing Out Companies and Addresses
      • Managing Companies
        • Stubbing Out the Navigation
        • A Shared View to Confirm Deletions
        • Attaching a Person to a Company
        • Creating and Updating Companies
      • Managing Addresses
        • Adding a Callback to Company Deletions
        • A Very Quick Interface for Addresses
    • Summary
  • Chapter 6: Into Production
    • An Application Ready for Production
    • The Application Server
      • Memory
      • Central Processor Unit–CPU
      • Hard Disks
      • Network Interface Card–NIC
      • Don't Forget Backup
      • Your First Production Server
    • Setting up the Server
      • Installing Ruby and Rails
      • Copying the Files to the Server
      • Using Subversion to Transfer the Application to the Production Environment
      • Excluding Files from the Repository
      • The Production Database
      • Separating Development and Production Databases
        • Localhost database–single database.yml
        • Separate Development and Production database.yml files
        • Using Migration in Production
        • The Rails Database User
      • The Web Server
        • Mongrel
        • Mongrel Service on Windows
        • Limitations of Mongrel
        • Mongrel behind Apache
        • Installing Apache
        • Apache on Linux and Mac OS X
        • Apache on Windows
        • Domain Name System (DNS)
        • Configuring Apache to Act as a Proxy for a Rails Application
    • Rory's Production Installation
      • Using Two Host Names to Simplify Routing
      • Rory Puts his Intranet Application into Production
    • Errors in Production
      • Slow List Rendering due to Placement of Additional Data Processing in Loop
        • Symptom
        • Cause
        • Fix
      • Application Error Following the Transferring of New Code to Production
        • Symptom
        • Cause
        • Solution
    • Back Up Rails
      • Backing Up the Code Repository
      • Back Up the Database
      • Combining Your Backup Scripts
    • Summary
  • Chapter 7: Improving the User Experience
    • Easy Access to the Application
      • Use Routes to Simplify the Entry Point URL
      • Build a Fast, Clear Home Page
    • Users Need to be Able to Find Items Easily
      • Use the Index View as the Core of the Search View
      • Search–The First Attempt
      • Do Not Trust User Input
      • Handle Nothing
      • Users Need to be Able to Search Without Knowing Exactly What They Are Looking for
      • A Less Specific Search
      • Case Insensitive Searches
    • Adding AJAX to the Mix
      • Make the AJAX Libraries Available to our Rails Application
        • Enhancing Search with Auto-complete
        • Auto-complete—Wow!, but...
      • Use of AJAX—the Lessons Learned from Auto-Complete
    • Show and Hide Company Address Using link_to_remote
      • A Simple link_to_remote
        • A DOM Object to Update
        • Create a say_hello Action
      • Increasing the Functionality of link_to_remote
        • Show and Hide
        • Alternating link_to_remote Elements
        • Alternative Actions
        • Debugging JavaScript
        • Show/Hide within the Company Index List
      • Using AJAX to Edit a Field in Line
        • Render an AJAX Form via link_to_remote
      • A Little script.aculo.us: Drag and Drop
        • Make an Element Draggable
        • A Place to Drop the Element
      • Further AJAX
    • Help!
      • RDoc–Documentation for the Developer
      • Help for the User
        • Instiki Wiki Help
        • The Best User Help Systems
    • Keep Talking to Users
    • Summary
  • Chapter 8: Extending the Application
    • Dealing with User Feedback
    • Adding a Search Facility
    • Handling Errors
      • Catching Missing Record Errors
      • Catching UnknownAction and Routing Errors
      • Catching General Application-Level Errors
      • Catching "Rails has Fallen Over" Errors
    • Adding an Authentication System
      • Cookies and Sessions in Rails
      • Building the Authentication System
        • The User Model
        • Displaying the Login Form
        • Checking Submitted Credentials
        • Logging Out
        • Protecting Actions
    • Adding Simple Task Tracking
      • The Task Model
      • The Tasks Controller
      • Task Views
      • Showing Tasks for a Person
      • Redirecting to a Person after Adding or Editing a Task
      • Redirecting after a Deletion
      • Handling the Cancel Link
      • Setting a Default Person for a New Task
      • Summary
    • Uploading and Attaching Files
      • Using Plugins
      • Using acts_as_attachment for File Uploads
      • Managing File Attachments for a Task
        • Adding a Form for Attaching a File to a Task
        • Adding a File Attachment to a Task
        • Listing File Attachments for a Task
        • Deleting File Attachments for a Task
        • Protecting File Attachment Actions
    • Summary
  • Chapter 9: Advanced Deployment
    • Deployment with Capistrano
      • Getting Started with Capistrano
        • A Complete Deployment Recipe
      • Preparing the Production Database
      • First Deployment
      • Migrating the Production Database
      • Running Other Commands on the Server with invoke
      • Managing Mongrel from Capistrano
      • Centralizing File Uploads
        • Upgrading the Application
        • Cleaning Up Obsolete Releases
      • Downgrading the Application
    • Troubleshooting Deployment
      • Incompatible Rails Versions
      • Missing Libraries
      • Incorrect Subversion Password or Repository Permissions
      • User Doesn't Have SSH Access to the Server
      • Inaccessible Application Server
      • Inaccessible Database Server
      • Dealing with the Inexplicable
      • Getting Back to a Clean Slate
    • Housekeeping
      • Starting Mongrel Automatically
      • Clearing Out Stale Sessions
      • Keeping Log Files Manageable
        • Reducing Log Detail
    • Optimizing a Rails Application
      • Finding Bottlenecks
        • Controller Action Profiling Using around_filter
        • Profiling Everything
        • The Rails Profiler
      • Improving Application Performance with Caching
        • How Cache Elements are Named
        • Deciding What to Cache
        • Preparing for Caching
        • Page Caching
        • Action Caching
        • Fragment Caching
        • Fragment Caching for Actions
        • Avoiding Database Calls for Cached Fragments
        • Clearing out the Cache
      • Optimizing How Rails Uses the Database
        • Ordering for Eager Loading
      • Scaling Your Rails Infrastructure
        • Using Apache to Serve Static Assets
        • Proxying to a Mongrel Cluster
      • Advanced Scaling
    • Summary
  • Chapter 10: Down the Track
    • Going off the Rails
    • SQL
      • Gathering Data from a Daughter Object's Daughter
        • Using a model’s ActiveRecord connection
        • Using GROUP BY to Summarize Data
        • A Deeper Look at Aggregate Functions
    • Business Processes
      • To Be Successful, Build Successful Business Applications
        • Automate Simple Repetitive Jobs
        • Rapid and Detailed Reporting
        • Ensure Customers Pay for the Goods and Services that the Business Provides
        • Review of Business Activity Examples
      • Dealing with Success
        • Just Because You Can, Doesn't Mean You Should
        • Bought in solutions Provide their Own Opportunities
        • Ensure There is Time to Complete Each Task
    • The Final Destination

Back to BOOK PAGE

Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Sort A-Z