| Introduction | p. xv |
| Introduction to Ruby on Rails | p. 3 |
| A history of Ruby | p. 5 |
| Object-oriented programming | p. 6 |
| Riding the Rails | p. 7 |
| Components of Rails | p. 8 |
| Model, View, Controller | p. 11 |
| Rails' database support | p. 12 |
| Who uses Rails? | p. 12 |
| Is Rails safe? | p. 14 |
| Summary | p. 14 |
| Installing Rails | p. 17 |
| Installing Rails on Mac OS X | p. 18 |
| Installing Xcode | p. 19 |
| Semiautomatic Rails install | p. 21 |
| Manual install | p. 22 |
| Setting the file path correctly | p. 22 |
| Setting up Ruby on Mac OS X | p. 23 |
| Installing the Rails framework on Mac OSX finally! | p. 24 |
| Installing FastCGI | p. 24 |
| Installing Lighttpd | p. 25 |
| Installing MySQL on Mac OSX | p. 26 |
| Locomotive | p. 27 |
| Extra tools for Mac OSX | p. 28 |
| Installing Rails on Windows | p. 28 |
| Installing Ruby on Windows | p. 28 |
| Installing MySQL on Windows | p. 30 |
| InstantRails-Rails for Windows | p. 35 |
| Extra tools for Windows | p. 35 |
| Ready? Let's do it! | p. 36 |
| Ruby for Rails Developers | p. 39 |
| Basic Ruby syntax | p. 40 |
| Ruby variables | p. 41 |
| Classes and objects | p. 42 |
| Inheritance | p. 46 |
| Polymorphism | p. 47 |
| Calling objects | p. 48 |
| Arrays and hashes | p. 48 |
| Decision structures | p. 49 |
| While | p. 50 |
| Iterators | p. 50 |
| Exception handling | p. 51 |
| Summary | p. 51 |
| Getting Started with Rails | p. 53 |
| Creating a Rails project | p. 56 |
| Configuring the web server | p. 57 |
| Viewing the application | p. 58 |
| Creating the database | p. 59 |
| Windows | p. 60 |
| Mac OS X | p. 60 |
| Using the command line | p. 61 |
| Telling Rails about the databases | p. 62 |
| Creating the model | p. 63 |
| Rails migrations | p. 64 |
| Creating the controller | p. 67 |
| Creating the views | p. 69 |
| Creating the first objects | p. 71 |
| Updating existing ads | p. 74 |
| Removing an ad | p. 76 |
| Adding some style | p. 77 |
| Summary | p. 81 |
| More Advanced Rails | p. 83 |
| Validating data | p. 84 |
| Implementing validations in railslist | p. 85 |
| Other common validations | p. 88 |
| Adding categories with migrations | p. 88 |
| Creating associations between models | p. 90 |
| Working with the new relationship | p. 92 |
| Controlling the categories | p. 93 |
| Modifying URLs using routing | p. 95 |
| Defining your own routes | p. 96 |
| Defining route en masse | p. 97 |
| Named routes | p. 97 |
| Basic debugging | p. 99 |
| Rails console | p. 99 |
| Reading existing data | p. 101 |
| Breakpointer | p. 101 |
| Debugging views | p. 103 |
| Summary | p. 104 |
| Formatting Data | p. 107 |
| NumberHelper | p. 108 |
| Other helpers | p. 110 |
| DateHelper | p. 110 |
| Defining date formats | p. 113 |
| Using natural language | p. 114 |
| Summary | p. 115 |
| Introduction to Ajax | p. 117 |
| A history of web interaction | p. 118 |
| What is Ajax? | p. 120 |
| Where is Ajax used? | p. 121 |
| How does Rails do Ajax? | p. 121 |
| When to use Ajax? | p. 123 |
| What's the catch? | p. 123 |
| Summary | p. 124 |
| Bringing Forms to Life with Ajax | p. 127 |
| Ajaxing your application | p. 128 |
| Creating the categories controller | p. 128 |
| Adding a touch of Ajax | p. 132 |
| Partials | p. 134 |
| Adding dynamic JavaScript functionality using RJS | p. 135 |
| What about validation? | p. 136 |
| Deleting items with Ajax | p. 137 |
| Searching classifieds with Ajax | p. 139 |
| Creating the search box | p. 140 |
| Sending e-mail with Action Mailer | p. 142 |
| Configuring Action Mailer | p. 142 |
| Let's send some e-mail | p. 143 |
| A bit of CSS style | p. 146 |
| Summary | p. 147 |
| Uploading Files and Sending Attachments | p. 149 |
| Uploading images to your database | p. 150 |
| Reading files from the database | p. 153 |
| Securing your data field | p. 154 |
| Updating the remaining views | p. 155 |
| Sending e-mail with attachments | p. 156 |
| Adding some style | p. 158 |
| Summary | p. 159 |
| User Authentication and Session Management | p. 161 |
| Before you begin | p. 162 |
| Mac OS X | p. 162 |
| Windows XP | p. 163 |
| Creating the user model | p. 164 |
| Adding data model validations and associations | p. 165 |
| Adding a new controller | p. 166 |
| Creating a signup form | p. 167 |
| Securing the users | p. 169 |
| Creating a login form | p. 170 |
| Adding the login code to the backend | p. 172 |
| How to store session data | p. 173 |
| Working with the sessions | p. 175 |
| Locking railslist down | p. 175 |
| Securing the categories controller | p. 178 |
| Assigning classifieds to users | p. 179 |
| Removing the email field | p. 180 |
| Logging out | p. 180 |
| Summary | p. 181 |
| Customizing Rails Views | p. 183 |
| Organizing listings | p. 184 |
| Using helper methods in views | p. 186 |
| Adding Web 2.0 style | p. 187 |
| Creating a tag cloud from the categories | p. 189 |
| Adding microformats | p. 194 |
| Adding microformats to Railslist | p. 198 |
| Summary | p. 201 |
| Using Rails Plug-ins and Engines | p. 203 |
| Building applications with scaffolding | p. 204 |
| Creating a new application with scaffolding | p. 204 |
| Testing the scaffolds | p. 206 |
| Analyzing the code | p. 207 |
| Scaffolded model | p. 210 |
| Adding functionality with plug-ins | p. 212 |
| Using plug-ins | p. 212 |
| Using acts_as_taggable | p. 214 |
| Using engines in the application | p. 217 |
| Migrating the database | p. 218 |
| Configuring login_engine | p. 219 |
| A note on components | p. 220 |
| Summary | p. 221 |
| Deploying with Capistrano | p. 223 |
| What is deployment? | p. 224 |
| Tool requirements | p. 226 |
| Installing Subversion for Mac OS X | p. 226 |
| Installing Subversion for Windows | p. 227 |
| Before you begin | p. 228 |
| Creating the MySQL database | p. 228 |
| Setting up the server | p. 230 |
| Committing the project to Subversion | p. 233 |
| Installing Capistrano | p. 234 |
| Connecting to the server on a Mac | p. 235 |
| Connecting to the server on Windows | p. 236 |
| Deploying the application | p. 236 |
| Summary | p. 237 |
| Caching Your Content | p. 239 |
| Setting up the caching strategy | p. 241 |
| Implementing caching in the application | p. 242 |
| Using fragment caching explicitly | p. 242 |
| Expiring caches | p. 243 |
| Summary | p. 244 |
| Testing Rails | p. 247 |
| What is test-driven development? | p. 248 |
| Test directory | p. 249 |
| Fixtures folder | p. 249 |
| Functional folder | p. 250 |
| Integration folder | p. 250 |
| Mock folder | p. 250 |
| Test folder | p. 250 |
| Unit folder | p. 250 |
| Creating a test database | p. 250 |
| On Windows | p. 251 |
| On Mac | p. 251 |
| Preparing the test database | p. 251 |
| Unit-testing the models | p. 251 |
| Running the first test | p. 252 |
| Other unit test assertions | p. 255 |
| Functional testing of the controller | p. 256 |
| Running all the tests at once | p. 258 |
| Summary | p. 259 |
| Index | p. 261 |
| Table of Contents provided by Ingram. All Rights Reserved. |