Foreword to the First Edition | p. xv |
Foreword to the First Edition | p. xvii |
Acknowledgments | p. xix |
About the Author | p. xxi |
From Zero to Deploy | p. 1 |
Introduction | p. 3 |
Comments for Various Readers | p. 4 |
"Scaling" Rails | p. 7 |
Conventions in This Book | p. 7 |
Up and Running | p. 9 |
Development Environments | p. 10 |
Ruby, RubyGems, Rails, and Git | p. 12 |
The First Application | p. 17 |
Bundler | p. 19 |
rails server | p. 23 |
Model-view-controller (MVC) | p. 25 |
Version Control with Git | p. 27 |
Installation and Setup | p. 27 |
Adding and Committing | p. 30 |
What Good Does Git Do You? | p. 31 |
GitHub | p. 32 |
Branch, Edit, Commit, Merge | p. 34 |
Deploying | p. 39 |
Heroku Setup | p. 39 |
Heroku Deployment, Step One | p. 40 |
Heroku Deployment, Step Two | p. 40 |
Heroku Commands | p. 41 |
Conclusion | p. 43 |
A Demo App | p. 45 |
Planning the Application | p. 45 |
Modeling Demo Users | p. 47 |
Modeling Demo Microposts | p. 48 |
The Users Resource | p. 49 |
A User Tour | p. 51 |
MVC in Action | p. 56 |
Weaknesses of this Users Resource | p. 62 |
The Microposts Resource | p. 63 |
A Micropost Microtour | p. 63 |
Putting the micro in Microposts | p. 66 |
A User has_many Microposts | p. 68 |
Inheritance Hierarchies | p. 70 |
Deploying the Demo App | p. 73 |
Conclusion | p. 74 |
Mostly Static Pages | p. 77 |
Static Pages | p. 82 |
Truly Static Pages | p. 82 |
Static Pages with Rails | p. 85 |
Our First Tests | p. 93 |
Test-driven Development | p. 93 |
Adding a Page | p. 99 |
Slightly Dynamic Pages | p. 103 |
Testing a Tide Change | p. 103 |
Passing Tide Tests | p. 106 |
Embedded Ruby | p. 108 |
Eliminating Duplication with Layouts | p. 111 |
Conclusion | p. 114 |
Exercises | p. 114 |
Advanced Setup | p. 117 |
Eliminating bundle exec | p. 118 |
Automated Tests with Guard | p. 120 |
Speeding up Tests with Spork | p. 123 |
Tests inside Sublime Text | p. 127 |
Rails-Flavored Ruby | p. 129 |
Motivation | p. 129 |
Strings and Methods | p. 134 |
Comments | p. 134 |
Strings | p. 135 |
Objects and Message Passing | p. 138 |
Method Definitions | p. 141 |
Back to the Title Helper | p. 142 |
Other Data Structures | p. 142 |
Arrays and Ranges | p. 142 |
Blocks | p. 146 |
Hashes and Symbols | p. 148 |
CSS revisited | p. 152 |
Ruby Classes | p. 153 |
Constructors | p. 153 |
Class Inheritance | p. 155 |
Modifying Built-in Classes | p. 158 |
A Controller Class | p. 159 |
A User Class | p. 161 |
Conclusion | p. 164 |
Exercises | p. 164 |
Filling in the Layout | p. 167 |
Adding Some Structure | p. 167 |
Site Navigation | p. 169 |
Bootstrap and Custom CSS | p. 175 |
Partials | p. 181 |
Sass and the Asset Pipeline | p. 187 |
The Asset Pipeline | p. 187 |
Syntactically Awesome Stylesheets | p. 190 |
Layout Links | p. 197 |
Route Tests | p. 200 |
Rails Routes | p. 202 |
Named Routes | p. 205 |
Pretty RSpec | p. 207 |
User Signup: A First Step | p. 211 |
Users Controller | p. 212 |
Signup URI | p. 213 |
Conclusion | p. 215 |
Exercises | p. 217 |
Modeling Users | p. 221 |
User Model | p. 222 |
Database Migrations | p. 223 |
The Model File | p. 228 |
Creating User Objects | p. 230 |
Finding User Objects | p. 233 |
Updating User Objects | p. 235 |
User Validations | p. 236 |
Initial User Tests | p. 236 |
Validating Presence | p. 239 |
Length Validation | p. 243 |
Format Validation | p. 245 |
Uniqueness Validation | p. 249 |
Adding a Secure Password | p. 254 |
An Encrypted Password | p. 255 |
Password and Confirmation | p. 257 |
User Authentication | p. 260 |
User Has Secure Password | p. 263 |
Creating a User | p. 265 |
Conclusion | p. 267 |
Exercises | p. 268 |
Sign Up | p. 271 |
Showing Users | p. 271 |
Debug and Rails Environments | p. 272 |
A Users Resource | p. 278 |
Testing the User Show Page (with Factories) | p. 282 |
A Gravatar Image and a Sidebar | p. 286 |
Signup Form | p. 292 |
Tests for User Signup | p. 293 |
Using form_for | p. 297 |
The Form HTML | p. 301 |
Signup Failure | p. 303 |
A Working Form | p. 303 |
Signup Error Messages | p. 308 |
Signup Success | p. 312 |
The Finished Signup Form | p. 313 |
The Flash | p. 315 |
The First Signup | p. 317 |
Deploying to Production with SSL | p. 317 |
Conclusion | p. 321 |
Exercises | p. 321 |
Sign In, Sign Out | p. 325 |
Sessions and Signin Failure | p. 325 |
Sessions Controller | p. 326 |
Signin Tests | p. 330 |
Signin Form | p. 333 |
Reviewing Form Submission | p. 336 |
Rendering with a Flash Message | p. 339 |
Signin Success | p. 343 |
Remember Me | p. 343 |
A Working sign_in Method | p. 349 |
Current User | p. 351 |
Changing the Layout Links | p. 355 |
Signin upon Signup | p. 359 |
Signing Out | p. 361 |
Introduction to Cucumber (Optional) | p. 363 |
Installation and Setup | p. 364 |
Features and Steps | p. 365 |
Counterpoint: RSpec Custom Matchers | p. 368 |
Conclusion | p. 371 |
Exercises | p. 372 |
Updating, Showing, and Deleting Users | p. 373 |
Updating Users | p. 373 |
Edit Form | p. 374 |
Unsuccessful Edits | p. 380 |
Successful Edits | p. 382 |
Authorization | p. 385 |
Requiring Signed-in Users | p. 386 |
Requiring the Right User | p. 390 |
Friendly Forwarding | p. 392 |
Showing All Users | p. 396 |
User Index | p. 396 |
Sample Users | p. 403 |
Pagination | p. 404 |
Partial Refactoring | p. 410 |
Deleting Users | p. 413 |
Administrative Users | p. 413 |
The destroy Action | p. 417 |
Conclusion | p. 422 |
Exercises | p. 424 |
User Microposts | p. 429 |
A Micropost Model | p. 429 |
The Basic Model | p. 430 |
Accessible Attributes and the First Validation | p. 432 |
User/Micropost Associations | p. 433 |
Micropost Refinements | p. 439 |
Content Validations | p. 443 |
Showing Microposts | p. 445 |
Augmenting the User Show Page | p. 446 |
Sample Microposts | p. 450 |
Manipulating Microposts | p. 454 |
Access Control | p. 456 |
Creating Microposts | p. 459 |
A Proto-feed | p. 467 |
Destroying Microposts | p. 475 |
Conclusion | p. 479 |
Exercises | p. 480 |
Following Users | p. 483 |
The Relationship Model | p. 484 |
A Problem with the Data Model (and a Solution) | p. 485 |
User/Relationship Associations | p. 491 |
Validations | p. 495 |
Followed users | p. 495 |
Followers | p. 500 |
A Web Interface for Following Users | p. 503 |
Sample Following Data | p. 503 |
Stats and a Follow Form | p. 505 |
Following and Followers Pages | p. 515 |
A Working Follow Button the Standard Way | p. 519 |
A Working Follow Button with Ajax | p. 524 |
The Status Feed | p. 529 |
Motivation and Strategy | p. 530 |
A First Feed Implementation | p. 532 |
Subselects | p. 535 |
The New Status Feed | p. 538 |
Conclusion | p. 539 |
Extensions to the Sample Application | p. 540 |
Guide to Further Resources | p. 542 |
Exercises | p. 543 |
Index | p. 545 |
Table of Contents provided by Ingram. All Rights Reserved. |
The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.
The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.