![Agile Web Development with Rails 6](http://img.images-bn.com/static/redesign/srcs/images/grey-box.png?v11.9.4)
![Agile Web Development with Rails 6](http://img.images-bn.com/static/redesign/srcs/images/grey-box.png?v11.9.4)
eBook
Available on Compatible NOOK devices, the free NOOK App and in My Digital Library.
Related collections and offers
Overview
Learn Rails the way the Rails core team recommends it, along with the tens of thousands of developers who have used this broad, far-reaching tutorial and reference. If you're new to Rails, you'll get step-by-step guidance. If you're an experienced developer, get the comprehensive, insider information you need for the latest version of Ruby on Rails. The new edition of this award-winning classic is completely updated for Rails 6 and Ruby 2.6, with information on system testing, Webpack, and advanced JavaScript.
Ruby on Rails helps you produce high-quality, beautiful-looking web applications quickly - you concentrate on creating the application, and Rails takes care of the details. Rails 6 brings many improvements, and this edition is updated to cover the new features and changes in best practices.
We start with a step-by-step walkthrough of building a real application, and in-depth chapters look at the built-in Rails features. Follow along with an extended tutorial as you write a web-based store application. Eliminate tedious configuration and housekeeping, seamlessly incorporate Ajax and JavaScript, send and receive emails, manage background jobs with ActiveJob, and build real-time features using WebSockets and ActionCable. Test your applications as you write them using the built-in unit, integration, and system testing frameworks, internationalize your applications, and deploy your applications easily and securely. New in this edition is coverage of Action Mailer, which allows you to receive emails in your app as well as ActionText, a zero-configuration rich text editing feature.
Rails 1.0 was released in December 2005. This book was there from the start, and didn't just evolve alongside Rails, it evolved with Rails. It has been developed in consultation with the Rails core team. In fact, Rails itself is tested against the code in this book.
What You Need:
All you need is a Windows, Mac OS X, or Linux machine to do development on. This book will take you through the steps to install Rails and its dependencies. If you aren't familiar with the Ruby programming language, this book contains a chapter that covers the basics necessary to understand the material in the book.
Product Details
ISBN-13: | 9781680507539 |
---|---|
Publisher: | Pragmatic Bookshelf |
Publication date: | 02/10/2020 |
Sold by: | Barnes & Noble |
Format: | eBook |
Pages: | 494 |
File size: | 11 MB |
Note: | This product may take a few minutes to download. |
About the Author
Sam Ruby is president of the Apache Software Foundation, previously co-chaired the W3C HTML Working Group, and has made significant contributions to many open source projects and standards.
David Bryant Copeland has been a professional programmer since 1995. He's the author of Build Awesome Command-Line Applications in Ruby 2 and Rails, Angular, Postgres, and Bootstrap. He has worked at LivingSocial and Opower, and is the Chief Software Architect at Stitch Fix.
Dave Thomas, as one of the authors of the Agile Manifesto, understands agility. As the author of Programming Ruby, he understands Ruby. And, as an active Rails developer, he knows Rails.
Table of Contents
Foreword to the Rails 5 Edition ix
Preface to the Rails 6 Edition xi
Acknowledgments xiii
Introduction xv
Part I Getting Started
1 Installing Rails 3
Installing on Windows 4
Installing on macOS 8
Installing on Linux 9
Choosing a Rails Version 14
Setting Up Your Development Environment 15
Rails and Databases 18
2 Instant Gratification 21
Creating a New Application 21
Hello, Rails! 24
Linking Pages Together 30
When Things Go Wrong 33
3 The Architecture of Rails Applications 37
Models, Views, and Controllers 37
Rails Model Support 40
Action Pack: The View and Controller 42
4 Introduction to Ruby 45
Ruby Is an Object-Oriented Language 45
Data Types 47
Logic 51
Organizing Structures 54
Marshaling Objects 57
Pulling It All Together 57
Ruby Idioms 58
Part II Building an Application
5 The Depot Application 63
Incremental Development 63
What Depot Does 64
Let's Code 68
6 Task A: Creating the Application 69
Iteration A1 Creating the Product Maintenance Application 69
Iteration A2 Making Prettier Listings 76
7 Task B: Validation and Unit Testing 87
Iteration B1 Validating! 87
Iteration B2 Unit Testing of Models 91
8 Task C: Catalog Display 103
Iteration C1 Creating the Catalog Listing 103
Iteration C2 Adding a Page Layout 107
Iteration C3 Using a Helper to Format the Price 112
Iteration C4 Functional Testing of Controllers 113
Iteration C5 Caching of Partial Results 116
9 Task D: Cart Creation 121
Iteration D1 Finding a Cart 121
Iteration D2 Connecting Products to Carts 122
Iteration D3 Adding a Button 125
10 Task E: A Smarter Cart 133
Iteration E1 Creating a Smarter Cart 133
Iteration E2 Handling Errors 138
Iteration E3 Finishing the Cart 143
11 Task F: Adda Dash of Ajax 151
Iteration F1 Moving the Cart 152
Iteration F2 Creating an Ajax-Based Cart 159
Iteration F3 Highlighting Changes 164
Iteration F4 Hiding an Empty Cart with a Custom Helper 167
Iteration F5 Broadcasting Updates with Action Cable 169
12 Task G: Check Out! 175
Iteration G1 Capturing an Order 175
Iteration G2 Atom Feeds 189
13 Task H: Entering Additional Payment Details 195
Iteration H1 Adding Fields Dynamically to a Form 195
Iteration H2 Testing Our JavaScript Functionality 212
14 Task I: Sending Emails and Processing Payments Efficiently 219
Iteration I1 Sending Confirmation Emails 219
Iteration I2 Connecting to a Slow Payment Processor with Active Job 226
15 Task J: Logging In 237
Iteration J1 Adding Users 237
Iteration J2 Authenticating Users 241
Iteration J3 Limiting Access 247
Iteration J4 Adding a Sidebar, More Administration 249
16 Task K: Internationalization 257
Iteration K1 Selecting the Locale 258
Iteration K2 Translating the Storefront 261
Iteration K3 Translating Checkout 269
Iteration K4 Adding a Locale Switcher 280
17 Task L: Receive Emails and Respond with Rich Text 285
Iteration L1 Receiving Support Emails with Action Mailbox 285
Iteration L2 Storing Support Requests from Our Mailbox 291
Iteration L3 Responding with Rich Text 297
Part III Rails in Depth
18 Finding Your Way Around Rails 309
Where Things Go 309
Naming Conventions 317
19 Active Record 321
Defining Your Data 321
Locating and Traversing Records 326
Creating, Reading, Updating, and Deleting (CRUD) 330
Participating in the Monitoring Process 344
Transactions 350
20 Action Dispatch and Action Controller 355
Dispatching Requests to Controllers 356
Processing of Requests 365
Objects and Operations That Span Requests 377
21 Action View 387
Using Templates 387
Generating Forms 389
Processing Forms 392
Uploading Files to Rails Applications 393
Using Helpers 397
Reducing Maintenance with Layouts and Partials 404
22 Migrations 413
Creating and Running Migrations 413
Anatomy of a Migration 416
Managing Tables 420
Advanced Migrations 425
When Migrations Go Bad 426
Schema Manipulation Outside Migrations 427
23 Customizing and Extending Rails 429
Testing with RSpec 429
Creating HTML Templates with Slim 435
Serving CSS via Webpack 437
Customizing Rails in Other Ways 439
Where to Go from Here 440
Bibliography 443
Index 445