Book description
The “Bible” for Rails Development: Fully Updated for Rails 5
“When I read The Rails Way for the first time, I felt like I truly understood Rails for the first time.”
–Steve Klabnik, Rails contributor and mentor
The Rails™ 5 Way is the comprehensive, authoritative reference guide for professionals delivering production-quality code using modern Ruby on Rails. Obie Fernandez illuminates the entire Rails 5 API, its most powerful idioms, design approaches, and libraries. He presents new and updated content on Action Cable, RSpec 3.4, Turbolinks 5.0, the Attributes API, and many other enhancements, both major and subtle.
Through detailed code examples, you’ll dive deep into Ruby on Rails, discover why it’s designed as it is, and learn to make it do exactly what you want. Proven in thousands of production systems, the knowledge in this book will maximize your productivity and help you build more successful solutions.
- Build powerful, scalable, REST-compliant back-end services
- Program complex program flows using Action Controller
- Represent models, relationships, and operations in Active Record, and apply advanced Active Record techniques
- Smoothly evolve database schema via Migrations
- Craft front-ends with ActionView and the Asset Pipeline
- Optimize performance and scalability with caching and Turbolinks 5.0
- Improve your productivity using Haml HTML templating
- Secure your systems against attacks like SQL Injection, XSS, and XSRF
- Integrate email using Action Mailer
- Enable real-time, websockets-based browser behavior with Action Cable
- Improve responsiveness with background processing
- Build “API-only” back-end projects that speak JSON
- Leverage enhancements to Active Job, serialization, and Ajax support
Register your product at informit.com/register for convenient access to downloads, updates, and/or corrections as they become available.
Table of contents
- Cover Page
- Title Page
- Copyright Page
- Contents
- Foreword by Giles Bowkett
- Foreword to the Previous Edition by Steve Klabnik
- Foreword to the Previous Edition by David Heinemeier Hansson
- Foreword to the Previous Edition by Yehuda Katz
- Introduction
- Acknowledgments
- About the Author
- Chapter 1 Rails Configuration and Environments
- Chapter 2 Routing
-
Chapter 3 REST, Resources, and Rails
- 3.1 REST in a Rather Small Nutshell
- 3.2 Resources and Representations
- 3.3 REST in Rails
- 3.4 Routing and CRUD
- 3.5 The Standard RESTful Controller Actions
- 3.6 Singular Resource Routes
- 3.7 Nested Resources
- 3.8 Routing Concerns
- 3.9 RESTful Route Customizations
- 3.10 Controller-Only Resources
- 3.11 Different Representations of Resources
- 3.12 The RESTful Rails Action Set
- 3.13 Conclusion
- Chapter 4 Working with Controllers
-
Chapter 5 Working with Active Record
- 5.1 The Basics
- 5.2 Macro-Style Methods
- 5.3 Defining Attributes
- 5.4 CRUD: Creating, Reading, Updating, Deleting
- 5.5 Database Locking
- 5.6 Querying
- 5.7 Ignoring Columns
- 5.8 Connections to Multiple Databases in Different Models
- 5.9 Using the Database Connection Directly
- 5.10 Custom SQL Queries
- 5.11 Other Configuration Options
- 5.12 Conclusion
- Chapter 6 Active Record Migrations
- Chapter 7 Active Record Associations
- Chapter 8 Validations
-
Chapter 9 Advanced Active Record
- 9.1 Scopes
- 9.2 Callbacks
- 9.3 Attributes API
- 9.4 Serialized Attributes
- 9.5 Enums
- 9.6 Generating Secure Tokens
- 9.7 Calculation Methods
- 9.8 Batch Operations
- 9.9 Single-Table Inheritance (STI)
- 9.10 Abstract Base Model Classes
- 9.11 Polymorphic has_many Relationships
- 9.12 Foreign-Key Constraints
- 9.13 Modules for Reusing Common Behavior
- 9.14 Value Objects
- 9.15 Non-persisted Models
- 9.16 Modifying Active Record Classes at Runtime
- 9.17 PostgreSQL
- 9.18 Conclusion
- Chapter 10 Action View
-
Chapter 11 All about Helpers
- 11.1 ActiveModelHelper
- 11.2 AssetTagHelper
- 11.3 AssetUrlHelper
- 11.4 AtomFeedHelper
- 11.5 CacheHelper
- 11.6 CaptureHelper
- 11.7 ControllerHelper
- 11.8 CsrfHelper
- 11.9 DateHelper
- 11.10 DebugHelper
- 11.11 FormHelper
- 11.12 FormOptionsHelper
- 11.13 FormTagHelper
- 11.14 JavaScriptHelper
- 11.15 NumberHelper
- 11.16 OutputSafetyHelper
- 11.17 RecordTagHelper
- 11.18 RenderingHelper
- 11.19 SanitizeHelper
- 11.20 TagHelper
- 11.21 TextHelper
- 11.22 TranslationHelper and the I18n API
- 11.23 UrlHelper
- 11.24 Writing Your Own View Helpers
- 11.25 Wrapping and Generalizing Partials
- 11.26 Conclusion
- Chapter 12 Haml
- Chapter 13 Session Management
- Chapter 14 Authentication and Authorization
- Chapter 15 Security
- Chapter 16 Action Mailer
- Chapter 17 Caching and Performance
- Chapter 18 Background Processing
- Chapter 19 Asset Pipeline
- Chapter 20 Ajax on Rails
-
Chapter 21 Turbolinks
- 21.1 Turbolinks Usage
- 21.2 Building Your Turbolinks Application
- 21.3 Understanding Turbolinks Caching
- 21.4 Making Transformations Idempotent
- 21.5 Responding to Page Updates
- 21.6 Persisting Elements across Page Loads
- 21.7 Advanced Turbolinks
- 21.8 Turbolinks API Reference
- 21.9 Turbolinks Events
- 21.10 Conclusion
- Chapter 22 Action Cable
-
Chapter 23 RSpec
- 23.1 Introduction
- 23.2 Behavior-Driven Development
- 23.3 Basic Syntax and API
- 23.4 Custom Expectation Matchers
- 23.5 Helper Methods
- 23.6 Shared Behaviors
- 23.7 Shared Context
- 23.8 Mocks and Stubs
- 23.9 Running Specs
- 23.10 Factory Girl
- 23.11 RSpec and Rails
- 23.12 Feature Specs with Capybara
- 23.13 Working with Files in Your Specs
- 23.14 RSpec Tools
- 23.15 Conclusion
-
Appendix A Active Model API Reference
- A.1 AttributeAssignment
- A.2 AttributeMethods
- A.3 Callbacks
- A.4 Conversion
- A.5 Dirty
- A.6 Errors
- A.7 ForbiddenAttributesError
- A.8 Lint::Tests
- A.9 MissingAttributeError
- A.10 Model
- A.11 Name
- A.12 Naming
- A.13 SecurePassword
- A.14 Serialization
- A.15 Serializers::JSON
- A.16 Translation
- A.17 Type
- A.18 ValidationError
- A.19 Validations
- A.20 Validator
-
Appendix B Active Support API Reference
- B.1 Array
- B.2 Autoload
- B.3 BacktraceCleaner
- B.4 Benchmark
- B.5 Benchmarkable
- B.6 BigDecimal
- B.7 Cache::FileStore
- B.8 Cache::MemCacheStore
- B.9 Cache::MemoryStore
- B.10 Cache::NullStore
- B.11 Cache::Store
- B.12 CachingKeyGenerator
- B.13 Callbacks
- B.14 Class
- B.15 Concern
- B.16 Configurable
- B.17 Date
- B.18 DateAndTime
- B.19 DateTime
- B.20 Dependencies
- B.21 DescendantsTracker
- B.22 Digest::UUID
- B.23 Duration
- B.24 Enumerable
- B.25 ERB::Util
- B.26 EventedFileUpdateChecker
- B.27 FalseClass
- B.28 File
- B.29 FileUpdateChecker
- B.30 Gzip
- B.31 Hash
- B.32 HashWithIndifferentAccess
- B.33 Inflector
- B.34 Inflector::Inflections
- B.35 Integer
- B.36 JSON
- B.37 Kernel
- B.38 KeyGenerator
- B.39 LazyLoadHooks
- B.40 Locale
- B.41 LogSubscriber
- B.42 Logger
- B.43 MessageEncryptor
- B.44 MessageVerifier
- B.45 Module
- B.46 Module::Concerning
- B.47 Multibyte::Chars
- B.48 Multibyte::Unicode
- B.49 NameError
- B.50 NilClass
- B.51 Notifications
- B.52 NumberHelper
- B.53 Numeric
- B.54 Object
- B.55 OrderedOptions
- B.56 ProxyObject
- B.57 Railtie
- B.58 Range
- B.59 Regexp
- B.60 Rescuable
- B.61 SecureRandom
- B.62 SecurityUtils
- B.63 String
- B.64 StringInquirer
- B.65 Subscriber
- B.66 TaggedLogging
- B.67 TestCase
- B.68 Testing::Assertions
- B.69 Thread
- B.70 Time
- B.71 TimeWithZone
- B.72 TimeZone
- B.73 TrueClass
- B.74 XmlMini
- Appendix C Rails API
- Index
- Credits
- Code Snippets
Product information
- Title: The Rails 5 Way, Fourth Edition
- Author(s):
- Release date: November 2017
- Publisher(s): Addison-Wesley Professional
- ISBN: 9780134657691
You might also like
book
The Rails Way
The expert guide to building Ruby on Rails applications Ruby on Rails strips complexity from the …
book
The Rails™ 4 Way, Third Edition
The “Bible” for Rails Development: Now Fully Updated for Rails 4.1 "When I read The Rails …
book
Learning Rails 5
If you’re a web developer or designer ready to learn Ruby on Rails, this hands-on guide …
book
Agile Web Development with Rails 5, 1st Edition
Rails 5 and Ruby 2.2 bring many improvements, including new APIs and substantial performance enhancements, and …