11%
The Rails 4 Way

The Rails 4 Way

          
5
4
3
2
1

Out of Stock


Premium quality
Premium quality
Bookswagon upholds the quality by delivering untarnished books. Quality, services and satisfaction are everything for us!
Easy Return
Easy return
Not satisfied with this product! Keep it in original condition and packaging to avail easy return policy.
Certified product
Certified product
First impression is the last impression! Address the book’s certification page, ISBN, publisher’s name, copyright page and print quality.
Secure Checkout
Secure checkout
Security at its finest! Login, browse, purchase and pay, every step is safe and secured.
Money back guarantee
Money-back guarantee:
It’s all about customers! For any kind of bad experience with the product, get your actual amount back after returning the product.
On time delivery
On-time delivery
At your doorstep on time! Get this book delivered without any delay.
Notify me when this book is in stock
Add to Wishlist

About the Book

The “Bible” for Rails Development: Now Fully Updated for Rails 4.1   "When I read The Rails Way for the first time, I felt like I truly understood Rails for the first time.” —From the Foreword by Steve Klabnik   Ruby on Rails 4 is leaner, tighter, and even more valuable to professional web developers. More than ever, it helps you focus on what matters most: delivering business value via clean and maintainable code.   The Rails™ 4 Way is the only comprehensive, authoritative guide to delivering production-quality code with Rails 4. Kevin Faustino joins pioneering Rails developer Obie Fernandez to illuminate the entire Rails 4 API, including its most powerful and modern idioms, design approaches, and libraries. They present extensive new and updated content on security, performance, caching, Haml, RSpec, Ajax, the Asset Pipeline, and more.   Through detailed code examples, you’ll dive deep into the Rails 4 code base, discover why Rails is designed as it is, and learn how to make it do exactly what you want. Proven in dozens of production systems, this book’s techniques will maximize your productivity and help you build more successful solutions. You’ll want to keep this guide by your computer—you’ll refer to it constantly.   This guide will help you Build powerful, scalable REST-compliant APIs Program complex program flows using Action Controller Represent models, relationships, CRUD operations, searches, validation, callbacks, and more Smoothly evolve application database schema via Migrations Apply advanced Active Record techniques: single-table inheritance, polymorphic models, and more Create visual elements with Action View and partials Optimize performance and scalability with view caching Master the highly productive Haml HTML templating engine Make the most of Rails’ approach to session management Secure your systems with Rails 4’s improved authentication and authorization Resist SQL Injection, XSS, XSRF, and other attacks Extend Rails with popular gems and plugins, and learn to write your own Integrate email services with Action Mailer Use Ajax via Rails 4 support for unobtrusive JavaScript Improve responsiveness with background processing Leverage Asset Pipeline to simplify development, improve perceived performance, and reduce server burdens Accelerate implementation and promote maintainability with RSpec

Table of Contents:
Foreword by Steve Klabnik xxxix Foreword to the Previous Edition by David Heinemeier Hansson xli Foreword to the Previous Edition by Yehuda Katz xliii Introduction xlv Acknowledgments li About the Authors liii   Chapter 1: Rails Environments and Configuration 1 1.1 Bundler 2 1.2 Startup and Application Settings 9 1.3 Development Mode 18 1.4 Test Mode 22 1.5 Production Mode 23 1.6 Configuring a Database 26 1.7 Configuring Application Secrets 27 1.8 Logging 29 1.9 Conclusion 35   Chapter 2: Routing 37 2.1 The Two Purposes of Routing 38 2.2 The routes.rb File 39 2.3 Route Globbing 51 2.4 Named Routes 53 2.5 Scoping Routing Rules 57 2.6 Listing Routes 60 2.7 Conclusion 61   Chapter 3: REST, Resources, and Rails 63 3.1 REST in a Rather Small Nutshell 63 3.2 Resources and Representations 64 3.3 REST in Rails 65 3.4 Routing and CRUD 66 3.5 The Standard RESTful Controller Actions 69 3.6 Singular Resource Routes 73 3.7 Nested Resources 74 3.8 Routing Concerns 78 3.9 RESTful Route Customizations 79 3.10 Controller-Only Resources 83 3.11 Different Representations of Resources 86 3.12 The RESTful Rails Action Set 88 3.13 Conclusion 92   Chapter 4: Working with Controllers 95 4.1 Rack 96 4.2 Action Dispatch: Where It All Begins 99 4.3 Render unto View… 102 4.4 Additional Layout Options 111 4.5 Redirecting 111 4.6 Controller/View Communication 115 4.7 Action Callbacks 116 4.8 Streaming 121 4.9 Variants 126 4.10 Conclusion 127   Chapter 5: Working with Active Record 129 5.1 The Basics 130 5.2 Macro-Style Methods 131 5.3 Defining Attributes 133 5.4 CRUD: Create, Read, Update, and Delete 138 5.5 Database Locking 151 5.6 Where Clauses 155 5.7 Connections to Multiple Databases in Different Models 165 5.8 Using the Database Connection Directly 167 5.9 Other Configuration Options 171 5.10 Conclusion 171   Chapter 6: Active Record Migrations 173 6.1 Creating Migrations 173 6.2 Data Migration 187 6.3 schema.rb 189 6.4 Database Seeding 190 6.5 Database-Related Rake Tasks 191 6.6 Conclusion 194   Chapter 7: Active Record Associations 195 7.1 The Association Hierarchy 195 7.2 One-to-Many Relationships 196 7.3 The belongs_to Association 205 7.4 The has_many Association 214 7.5 Many-to-Many Relationships 222 7.6 One-to-One Relationships 233 7.7 Working with Unsaved Objects and Associations 236 7.8 Association Extensions 238 7.9 The CollectionProxy Class 239 7.10 Conclusion 240   Chapter 8: Validations 241 8.1 Finding Errors 241 8.2 The Simple Declarative Validations 242 8.3 Common Validation Options 253 8.4 Conditional Validation 255 8.5 Short-Form Validation 256 8.6 Custom Validation Techniques 258 8.7 Skipping Validations 260 8.8 Working with the Errors Hash 261 8.9 Testing Validations with Shoulda 262 8.10 Conclusion 262   Chapter 9: Advanced Active Record 263 9.1 Scopes 263 9.2 Callbacks 268 9.3 Calculation Methods 278 9.4 Single-Table Inheritance (STI) 280 9.5 Abstract Base Model Classes 286 9.6 Polymorphic has_many Relationships 287 9.7 Enums 290 9.8 Foreign-Key Constraints 292 9.9 Modules for Reusing Common Behavior 292 9.10 Modifying Active Record Classes at Runtime 297 9.11 Using Value Objects 299 9.12 Nonpersisted Models 302 9.13 PostgreSQL Enhancements 304 9.14 Conclusion 311   Chapter 10: Action View 313 10.1 Layouts and Templates 314 10.2 Partials 322 10.3 Conclusion 329   Chapter 11: All about Helpers 331 11.1 ActiveModelHelper 331 11.2 AssetTagHelper 338 11.3 AtomFeedHelper 346 11.4 CacheHelper 348 11.5 CaptureHelper 348 11.6 CsrfHelper 349 11.7 DateHelper 349 11.8 DebugHelper 356 11.9 FormHelper 357 11.10 FormOptionsHelper 371 11.11 FormTagHelper 379 11.12 JavaScriptHelper 385 11.13 NumberHelper 385 11.14 OutputSafetyHelper 390 11.15 RecordTagHelper 390 11.16 RenderingHelper 391 11.17 SanitizeHelper 391 11.18 TagHelper 393 11.19 TextHelper 395 11.20 TranslationHelper and the I18n API 399 11.21 UrlHelper 418 11.22 Writing Your Own View Helpers 422 11.23 Wrapping and Generalizing Partials 425 11.24 Conclusion 431   Chapter 12: Haml 433 12.1 Getting Started 434 12.2 The Basics 434 12.3 Doctype 440 12.4 Comments 440 12.5 Evaluating Ruby Code 441 12.6 Helpers 443 12.7 Filters 444 12.8 Haml and Content 445 12.9 Configuration Options 446 12.10 Conclusion 448   Chapter 13: Session Management 449 13.1 What to Store in the Session 450 13.2 Session Options 451 13.3 Storage Mechanisms 451 13.4 Cookies 455 13.5 Conclusion 457   Chapter 14: Authentication and Authorization 459 14.1 Devise 459 14.2 has_secure_password 466 14.3 Pundit 470 14.4 Conclusion 476   Chapter 15: Security 477 15.1 Password Management 477 15.2 Log Masking 479 15.3 SSL (Secure Sockets Layer) 480 15.4 Model Mass-Assignment Attributes Protection 481 15.5 SQL Injection 483 15.6 Cross-Site Scripting (XSS) 484 15.7 XSRF (Cross-Site Request Forgery) 487 15.8 Session Fixation Attacks 490 15.9 Keeping Secrets 491 15.10 Conclusion 492   Chapter 16: Action Mailer 493 16.1 Setup 493 16.2 Mailer Models 494 16.3 Receiving Emails 500 16.4 Server Configuration 502 16.5 Testing Email Content 502 16.6 Previews 503 16.7 Conclusion 504   Chapter 17: Caching and Performance 505 17.1 View Caching 505 17.2 Data Caching 521 17.3 Control of Web Caching 523 17.4 ETags 524 17.5 Conclusion 526   Chapter 18: Background Processing 527 18.1 Delayed Job 528 18.2 Sidekiq 531 18.3 Resque 537 18.4 Rails Runner 541 18.5 Conclusion 543   Chapter 19: Ajax on Rails 545 19.1 Unobtrusive JavaScript 547 19.2 Turbolinks 551 19.3 Ajax and JSON 553 19.4 Ajax and HTML 555 19.5 Ajax and JavaScript 557 19.6 Conclusion 558   Chapter 20: Asset Pipeline 559 20.1 Asset Pipeline 560 20.2 Wish List 560 20.3 The Big Picture 561 20.4 Organization: Where Does Everything Go? 561 20.5 Manifest Files 561 20.6 Custom Format Handlers 567 20.7 Postprocessing 568 20.8 Helpers 569 20.9 Fingerprinting 571 20.10 Serving the Files 572 20.11 Rake Tasks 573 20.12 Conclusion 574   Chapter 21: RSpec 575 21.1 Introduction 575 21.2 Basic Syntax and API 578 21.3 Matchers 587 21.4 Custom Expectation Matchers 588 21.5 Shared Behaviors 591 21.6 Shared Context 592 21.7 RSpec’s Mocks and Stubs 592 21.8 Running Specs 595 21.9 RSpec Rails Gem 596 21.10 RSpec Tools 609 21.11 Conclusion 610   Chapter 22: XML 611 22.1 The to_xml Method 611 22.2 The XML Builder 620 22.3 Parsing XML 622 22.4 Conclusion 624   Appendix A: Active Model API Reference 625 A.1 AttributeMethods 625 A.2 Callbacks 627 A.3 Conversion 629 A.4 Dirty 629 A.5 Errors 631 A.6 ForbiddenAttributesError 635 A.7 Lint::Tests 635 A.8 Model 635 A.9 Name 636 A.10 Naming 638 A.11 SecurePassword 638 A.12 Serialization 638 A.13 Serializers::JSON 639 A.14 Serializers::Xml 639 A.15 Translation 640 A.16 Validations 641 A.17 Validator 648   Appendix B: Active Support API Reference 651 B.1 Array 651 B.2 ActiveSupport::BacktraceCleaner 657 B.3 Benchmark 658 B.4 ActiveSupport::Benchmarkable 658 B.5 BigDecimal 659 B.6 ActiveSupport::Cache::Store 660 B.7 ActiveSupport::CachingKeyGenerator 665 B.8 ActiveSupport::Callbacks 665 B.9 Class 668 B.10 ActiveSupport::Concern 671 B.11 ActiveSupport::Concurrency 672 B.12 ActiveSupport::Configurable 673 B.13 Date 673 B.14 DateTime 682 B.15 ActiveSupport::Dependencies 687 B.16 ActiveSupport::Deprecation 693 B.17 ActiveSupport::DescendantsTracker 694 B.18 ActiveSupport::Duration 695 B.19 Enumerable 696 B.20 ERB::Util 697 B.21 FalseClass 698 B.22 File 698 B.23 Hash 699 B.24 ActiveSupport::Gzip 704 B.25 ActiveSupport::HashWithIndifferentAccess 705 B.26 ActiveSupport::Inflector::Inflections 705 B.27 Integer 711 B.28 ActiveSupport::JSON 712 B.29 Kernel 712 B.30 ActiveSupport::KeyGenerator 714 B.31 ActiveSupport::Logger 714 B.32 ActiveSupport::MessageEncryptor 715 B.33 ActiveSupport::MessageVerifier 715 B.34 Module 716 B.35 ActiveSupport::Multibyte::Chars 724 B.36 NilClass 729 B.37 ActiveSupport::Notifications 729 B.38 Object 738 B.39 ActiveSupport::OrderedHash 743 B.40 ActiveSupport::OrderedOptions 743 B.41 ActiveSupport::PerThreadRegistry 744 B.42 ActiveSupport::ProxyObject 744 B.43 ActiveSupport::Railtie 745 B.44 Range 746 B.45 Regexp 747 B.46 ActiveSupport::Rescuable 748 B.47 String 748 B.48 ActiveSupport::StringInquirer 758 B.49 Struct 758 B.50 ActiveSupport::Subscriber 758 B.51 Symbol 759 B.52 ActiveSupport::TaggedLogging 759 B.53 ActiveSupport::TestCase 759 B.54 ActiveSupport::Testing::Assertions 761 B.55 Thread 762 B.56 Time 763 B.57 ActiveSupport::TimeWithZone 773 B.58 ActiveSupport::TimeZone 774 B.59 TrueClass 778 B.60 ActiveSupport::XmlMini 778   Appendix C: Rails Essentials 781 C.1 Environmental Concerns 781 C.2 Essential Gems 782 C.3 Ruby Toolbox 789 C.4 Screencasts 789   Index 791


Best Sellers


Product Details
  • ISBN-13: 9780321944276
  • Publisher: Pearson Education (US)
  • Publisher Imprint: Addison-Wesley Educational Publishers Inc
  • Depth: 32
  • Height: 233 mm
  • No of Pages: 880
  • Series Title: Addison-Wesley Professional Ruby
  • Weight: 1090 gr
  • ISBN-10: 0321944275
  • Publisher Date: 12 Jun 2014
  • Binding: Paperback
  • Edition: 3
  • Language: English
  • Returnable: Y
  • Spine Width: 29 mm
  • Width: 180 mm


Similar Products

How would you rate your experience shopping for books on Bookswagon?

Add Photo
Add Photo

Customer Reviews

REVIEWS           
Click Here To Be The First to Review this Product
The Rails 4 Way
Pearson Education (US) -
The Rails 4 Way
Writing guidlines
We want to publish your review, so please:
  • keep your review on the product. Review's that defame author's character will be rejected.
  • Keep your review focused on the product.
  • Avoid writing about customer service. contact us instead if you have issue requiring immediate attention.
  • Refrain from mentioning competitors or the specific price you paid for the product.
  • Do not include any personally identifiable information, such as full names.

The Rails 4 Way

Required fields are marked with *

Review Title*
Review
    Add Photo Add up to 6 photos
    Would you recommend this product to a friend?
    Tag this Book
    Read more
    Does your review contain spoilers?
    What type of reader best describes you?
    I agree to the terms & conditions
    You may receive emails regarding this submission. Any emails will include the ability to opt-out of future communications.

    CUSTOMER RATINGS AND REVIEWS AND QUESTIONS AND ANSWERS TERMS OF USE

    These Terms of Use govern your conduct associated with the Customer Ratings and Reviews and/or Questions and Answers service offered by Bookswagon (the "CRR Service").


    By submitting any content to Bookswagon, you guarantee that:
    • You are the sole author and owner of the intellectual property rights in the content;
    • All "moral rights" that you may have in such content have been voluntarily waived by you;
    • All content that you post is accurate;
    • You are at least 13 years old;
    • Use of the content you supply does not violate these Terms of Use and will not cause injury to any person or entity.
    You further agree that you may not submit any content:
    • That is known by you to be false, inaccurate or misleading;
    • That infringes any third party's copyright, patent, trademark, trade secret or other proprietary rights or rights of publicity or privacy;
    • That violates any law, statute, ordinance or regulation (including, but not limited to, those governing, consumer protection, unfair competition, anti-discrimination or false advertising);
    • That is, or may reasonably be considered to be, defamatory, libelous, hateful, racially or religiously biased or offensive, unlawfully threatening or unlawfully harassing to any individual, partnership or corporation;
    • For which you were compensated or granted any consideration by any unapproved third party;
    • That includes any information that references other websites, addresses, email addresses, contact information or phone numbers;
    • That contains any computer viruses, worms or other potentially damaging computer programs or files.
    You agree to indemnify and hold Bookswagon (and its officers, directors, agents, subsidiaries, joint ventures, employees and third-party service providers, including but not limited to Bazaarvoice, Inc.), harmless from all claims, demands, and damages (actual and consequential) of every kind and nature, known and unknown including reasonable attorneys' fees, arising out of a breach of your representations and warranties set forth above, or your violation of any law or the rights of a third party.


    For any content that you submit, you grant Bookswagon a perpetual, irrevocable, royalty-free, transferable right and license to use, copy, modify, delete in its entirety, adapt, publish, translate, create derivative works from and/or sell, transfer, and/or distribute such content and/or incorporate such content into any form, medium or technology throughout the world without compensation to you. Additionally,  Bookswagon may transfer or share any personal information that you submit with its third-party service providers, including but not limited to Bazaarvoice, Inc. in accordance with  Privacy Policy


    All content that you submit may be used at Bookswagon's sole discretion. Bookswagon reserves the right to change, condense, withhold publication, remove or delete any content on Bookswagon's website that Bookswagon deems, in its sole discretion, to violate the content guidelines or any other provision of these Terms of Use.  Bookswagon does not guarantee that you will have any recourse through Bookswagon to edit or delete any content you have submitted. Ratings and written comments are generally posted within two to four business days. However, Bookswagon reserves the right to remove or to refuse to post any submission to the extent authorized by law. You acknowledge that you, not Bookswagon, are responsible for the contents of your submission. None of the content that you submit shall be subject to any obligation of confidence on the part of Bookswagon, its agents, subsidiaries, affiliates, partners or third party service providers (including but not limited to Bazaarvoice, Inc.)and their respective directors, officers and employees.

    Accept

    New Arrivals

    Inspired by your browsing history


    Your review has been submitted!

    You've already reviewed this product!
    ASK VIDYA