Browse Subject Headings
The Rails 5 Way
The Rails 5 Way
Click to enlarge
Author(s): Fernandez, Obed (Obie)
Fernandez, Obie
ISBN No.: 9780134657677
Pages: 1,088
Year: 201711
Format: Trade Paper
Price: $ 65.00
Status: Out Of Print

Foreword by Giles Bowkett xlix Foreword to the Previous Edition by Steve Klabnik liii Foreword to the Previous Edition by David Heinemeier Hansson lv Foreword to the Previous Edition by Yehuda Katz lvii Introduction lix Acknowledgments lxv About the Author lxvii Chapter 1: Rails Configuration and Environments 1 1.1 Bundler 2 1.2 Startup Scripts 10 1.3 Default Initializers 12 1.4 Other Common Initializers 19 1.5 Spring Application Preloader 21 1.6 Development Mode 22 1.7 Test Mode 27 1.


8 Production Mode 29 1.9 Configuring a Database 32 1.10 Configuring Application Secrets 33 1.11 Logging 34 1.12 Conclusion 41 Chapter 2: Routing 43 2.1 The Two Purposes of Routing 44 2.2 The routes.rb File 45 2.


3 Route Globbing 57 2.4 Named Routes 58 2.5 Scoping Routing Rules 63 2.6 Listing Routes 66 2.7 Conclusion 66 Chapter 3: REST, Resources, and Rails 69 3.1 REST in a Rather Small Nutshell 70 3.2 Resources and Representations 71 3.3 REST in Rails 71 3.


4 Routing and CRUD 72 3.5 The Standard RESTful Controller Actions 76 3.6 Singular Resource Routes 80 3.7 Nested Resources 80 3.8 Routing Concerns 85 3.9 RESTful Route Customizations 86 3.10 Controller-Only Resources 91 3.11 Different Representations of Resources 93 3.


12 The RESTful Rails Action Set 95 3.13 Conclusion 100 Chapter 4: Working with Controllers 101 4.1 Rack 102 4.2 Action Dispatch: Where It All Begins 105 4.3 Render unto View . 108 4.4 Additional Layout Options 120 4.5 Redirecting 121 4.


6 Controller/View Communication 124 4.7 Action Callbacks 125 4.8 Streaming 131 4.9 Variants 138 4.10 Conclusion 139 Chapter 5: Working with Active Record 141 5.1 The Basics 142 5.2 Macro-Style Methods 143 5.3 Defining Attributes 146 5.


4 CRUD: Creating, Reading, Updating, Deleting 149 5.5 Database Locking 162 5.6 Querying 166 5.7 Ignoring Columns 185 5.8 Connections to Multiple Databases in Different Models 186 5.9 Using the Database Connection Directly 187 5.10 Custom SQL Queries 191 5.11 Other Configuration Options 193 5.


12 Conclusion 194 Chapter 6: Active Record Migrations 195 6.1 Creating Migrations 195 6.2 Defining Columns 207 6.3 Transactions 214 6.4 Data Migration 214 6.5 Database Schema 218 6.6 Database Seeding 219 6.7 Database-Related Tasks 220 6.


8 Conclusion 224 Chapter 7: Active Record Associations 225 7.1 The Association Hierarchy 225 7.2 One-to-Many Relationships 226 7.3 Belongs to Associations 227 7.4 Has Many Associations 238 7.5 Many-to-Many Relationships 253 7.6 One-to-One Relationships 266 7.7 Working with Unsaved Objects and Associations 270 7.


8 Association Extensions 272 7.9 The CollectionProxy Class 274 7.10 Conclusion 275 Chapter 8: Validations 277 8.1 Finding Errors 277 8.2 The Simple Declarative Validations 278 8.3 Common Validation Options 289 8.4 Conditional Validation 291 8.5 Short-Form Validation 293 8.


6 Custom Validation Techniques 294 8.7 Skipping Validations 297 8.8 Working with the Errors Hash 298 8.9 Testing Validations with Shoulda 298 8.10 Conclusion 299 Chapter 9: Advanced Active Record 301 9.1 Scopes 302 9.2 Callbacks 306 9.3 Attributes API 317 9.


4 Serialized Attributes 325 9.5 Enums 329 9.6 Generating Secure Tokens 331 9.7 Calculation Methods 333 9.8 Batch Operations 334 9.9 Single-Table Inheritance (STI) 344 9.10 Abstract Base Model Classes 351 9.11 Polymorphic has_many Relationships 352 9.


12 Foreign-Key Constraints 355 9.13 Modules for Reusing Common Behavior 359 9.14 Value Objects 363 9.15 Non-persisted Models 366 9.16 Modifying Active Record Classes at Runtime 368 9.17 PostgreSQL 371 9.18 Conclusion 376 Chapter 10: Action View 377 10.1 Layouts and Templates 378 10.


2 Partials 387 10.3 Conclusion 393 Chapter 11: All about Helpers 395 11.1 ActiveModelHelper 395 11.2 AssetTagHelper 396 11.3 AssetUrlHelper 400 11.4 AtomFeedHelper 406 11.5 CacheHelper 408 11.6 CaptureHelper 408 11.


7 ControllerHelper 410 11.8 CsrfHelper 410 11.9 DateHelper 411 11.10 DebugHelper 418 11.11 FormHelper 418 11.12 FormOptionsHelper 438 11.13 FormTagHelper 446 11.14 JavaScriptHelper 452 11.


15 NumberHelper 453 11.16 OutputSafetyHelper 457 11.17 RecordTagHelper 458 11.18 RenderingHelper 459 11.19 SanitizeHelper 459 11.20 TagHelper 461 11.21 TextHelper 463 11.22 TranslationHelper and the I18n API 467 11.


23 UrlHelper 487 11.24 Writing Your Own View Helpers 492 11.25 Wrapping and Generalizing Partials 495 11.26 Conclusion 501 Chapter 12: Haml 503 12.1 Getting Started 504 12.2 The Basics 504 12.3 Doctype 509 12.4 Comments 509 12.


5 Evaluating Ruby Code 510 12.6 Helpers 513 12.7 Filters 514 12.8 Haml and Content 515 12.9 Configuration Options 516 12.10 Conclusion 518 Chapter 13: Session Management 519 13.1 What to Store in the Session 520 13.2 Storage Mechanisms 521 13.


3 Cookies 524 13.4 Conclusion 526 Chapter 14: Authentication and Authorization 527 14.1 Warden 527 14.2 Devise 531 14.3 has_sec.


To be able to view the table of contents for this publication then please subscribe by clicking the button below...
To be able to view the full description for this publication then please subscribe by clicking the button below...
Browse Subject Headings