Atjaunināt sīkdatņu piekrišanu

Agile Web Development with Rails 3rd Revised edition [Mīkstie vāki]

3.84/5 (2253 ratings by Goodreads)
  • Formāts: Paperback / softback, 850 pages, height x width x depth: 231x190x31 mm, weight: 1016 g, Illustrations
  • Izdošanas datums: 05-May-2009
  • Izdevniecība: The Pragmatic Programmers
  • ISBN-10: 1934356166
  • ISBN-13: 9781934356166
Citas grāmatas par šo tēmu:
  • Mīkstie vāki
  • Cena: 53,84 €*
  • * Šī grāmata vairs netiek publicēta. Jums tiks paziņota lietotas grāmatas cena
  • Šī grāmata vairs netiek publicēta. Jums tiks paziņota lietotas grāmatas cena.
  • Daudzums:
  • Ielikt grozā
  • Pievienot vēlmju sarakstam
  • Formāts: Paperback / softback, 850 pages, height x width x depth: 231x190x31 mm, weight: 1016 g, Illustrations
  • Izdošanas datums: 05-May-2009
  • Izdevniecība: The Pragmatic Programmers
  • ISBN-10: 1934356166
  • ISBN-13: 9781934356166
Citas grāmatas par šo tēmu:
Provides information on creating Web-based applications with Rails 2.

In this updated edition of the Jolt Award-winning book, users are shown a new approach to Web development using Rails 2, making this the most up-to-date and authoritative Rails book out there.

You want to write professional-grade applications: Rails is a full-stack, open-source web framework, with integrated support for unit, functional, and integration testing. It enforces good design principles, consistency of code across your team (and across your organization), and proper release management.

But Rails is more than a set of best practices. Rails makes it both fun and easy to turn out very cool web applications. Need Ajax support, so your web applications are highly interactive? Rails has it built in. Want an application that sends and receives e-mail? Built in. Supports internationalization and localization? Built in. Do you need applications with a REST-based interface (so they can interact with other RESTful applications with almost no effort on your part)? All built-in.

With this book, you'll learn how to use ActiveRecord to connect business objects and database tables. No more painful object-relational mapping. Just create your business objects and let Rails do the rest. Need to create and modify your schema? Migrations make it painless (and they're versioned, so you can roll changes backward and forward). You'll learn how to use the Action Pack framework to route incoming requests and render pages using easy-to-write templates and components. See how to exploit the Rails service frameworks to send emails, implement web services, and create dynamic, user-centric web-pages using built-in Javascript and Ajax support. There is extensive coverage of testing, and the rewritten Deployment chapter now covers Phusion Passenger.

As with the previous editions of the book, we start with an extended tutorial that builds parts of an online store. And, of course, the application has been rewritten to show the best of Rails V2.



In this updated edition of the Jolt Award-winning book, users are shown a new approach to Web development using Rails 2, making this the most up-to-date and authoritative Rails book out there.
Preface to the Second Edition xiii
Preface to the Third Edition xv
1 Introduction 1
1.1 Rails Is Agile
3
1.2 Finding Your Way Around
4
1.3 Acknowledgments
6
Part I Getting Started 9
2 The Architecture of Rails Applications
11
2.1 Models, Views, and Controllers
11
2.2 Active Record: Rails Model Support
14
2.3 Action Pack: The View and Controller
18
3 Installing Rails
21
3.1 Your Shopping List
21
3.2 Installing on Windows
21
3.3 Installing on Mac OS X
23
3.4 Installing on Linux
24
3.5 Choosing a Rails Version
26
3.6 Development Environments
26
3.7 Rails and Databases
30
3.8 Keeping Up-to-Date
32
3.9 Rails and ISPs
32
4 Instant Gratification
35
4.1 Creating a New Application
35
4.2 Hello, Rails!
37
4.3 Linking Pages Together
48
4.4 What We Just Did
52
Part II Building an Application 53
5 The Depot Application
55
5.1 Incremental Development
55
5.2 What Depot Does
56
5.3 Let's Code
60
6 Task A: Product Maintenance
61
6.1 Iteration Al: Getting Something Running
61
6.2 Creating the Products Model and Maintenance Application
67
6.3 Iteration A2: Adding a Missing Column
71
6.4 Iteration A3: Validating!
77
6.5 Iteration A4: Making Prettier Listings
81
7 Task B: Catalog Display
87
7.1 Iteration B1: Creating the Catalog Listing
87
7.2 Iteration B2: Adding a Page Layout
91
7.3 Iteration B3: Using a Helper to Format the Price
93
7.4 Iteration B4: Linking to the Cart
94
8 Task C: Cart Creation
97
8.1 Sessions
97
8.2 Iteration C1: Creating a Cart
101
8.3 Iteration C2: Creating a Smarter Cart
104
8.4 Iteration C3: Handling Errors
107
8.5 Iteration C4: Finishing the Cart
112
9 Task D: Add a Dash of Ajax
117
9.1 Iteration D1: Moving the Cart
118
9.2 Iteration D2: Creating an Ajax-Based Cart
123
9.3 Iteration D3: Highlighting Changes
126
9.4 Iteration D4: Hiding an Empty Cart
129
9.5 Iteration D5: Degrading If Javascript Is Disabled
132
9.6 What We Just Did
133
10 Task E: Check Out!
135
10.1 Iteration El: Capturing an Order
135
11 Task F: Administration
153
11.1 Iteration Fl: Adding Users
153
11.2 Iteration F2: Logging In
162
11.3 Iteration F3: Limiting Access
165
11.4 Iteration F4: Adding a Sidebar, More Administration
168
12 Task G: One Last Wafer-Thin Change
175
12.1 Generating the XML Feed
175
12.2 Finishing Up
185
13 Task I: Internationalization
187
13.1 Iteration Il: Enabling Translation
187
13.2 Iteration 12: Exploring Strategies for Content
201
14 Task T: Testing
205
14.1 Tests Baked Right In
205
14.2 Unit Testing of Models
206
14.3 Functional Testing of Controllers
219
14.4 Integration Testing of Applications
235
14.5 Performance Testing
244
14.6 Using Mock Objects
248
Part III Working with the Rails Framework 251
15 Rails in Depth
253
15.1 So, Where's Rails?
253
15.2 Directory Structure
253
15.3 Rails Configuration
260
15.4 Naming Conventions
264
15.5 Logging in Rails
268
15.6 Debugging Hints
268
15.7 What's Next
270
16 Active Support
271
16.1 Generally Available Extensions
271
16.2 Enumerations and Arrays
272
16.3 Hashes
274
16.4 String Extensions
274
16.5 Extensions to Numbers
277
16.6 Time and Date Extensions
278
16.7 An Extension to Ruby Symbols
280
16.8 with_options
280
16.9 Unicode Support
281
17 Migrations
287
17.1 Creating and Running Migrations
289
17.2 Anatomy of a Migration
291
17.3 Managing Tables
295
17.4 Data Migrations
300
17.5 Advanced Migrations
303
17.6 When Migrations Go Bad
307
17.7 Schema Manipulation Outside Migrations
308
17.8 Managing Migrations
309
18 Active Record: The Basics
311
18.1 Tables and Classes
312
18.2 Columns and Attributes
312
18.3 Primary Keys and ids
316
18.4 Connecting to the Database
318
18.5 Create, Read, Update, Delete (CRUD)
323
18.6 Aggregation and Structured Data
342
18.7 Miscellany
349
19 Active Record: Relationships Between Tables
353
19.1 Creating Foreign Keys
354
19.2 Specifying Relationships in Models
356
19.3 belongs_to and has_xxx Declarations
358
19.4 Joining to Multiple Tables
373
19.5 Self-referential Joins
383
19.6 Acts As
384
19.7 When Things Get Saved
388
19.8 Preloading Child Rows
390
19.9 Counters
391
20 Active Record: Object Life Cycle
393
20.1 Validation
393
20.2 Callbacks
403
20.3 Advanced Attributes
410
20.4 Transactions
414
21 Action Controller: Routing and URLs
421
21.1 The Basics
421
21.2 Routing Requests
422
21.3 Resource-Based Routing
437
21.4 Testing Routing
454
22 Action Controller and Rails
457
22.1 Action Methods
457
22.2 Cookies and Sessions
469
22.3 Flash: Communicating Between Actions
482
22.4 Filters and Verification
484
22.5 Caching, Part One
492
22.6 The Problem with GET Requests
501
23 Action View
505
23.1 Templates
505
23.2 Using Helpers
511
23.3 Helpers for Formatting, Linking, and Pagination
512
23.4 How Forms Work
520
23.5 Forms That Wrap Model Objects
521
23.6 Custom Form Builders
534
23.7 Working with Nonmodel Fields
538
23.8 Uploading Files to Rails Applications
541
23.9 Layouts and Components
545
23.10 Caching, Part Two
552
23.11 Adding New Templating Systems
557
24 The Web, v2.0
561
24.1 Prototype
561
24.2 Script. aculo. us
581
24.3 RJS Templates
598
24.4 Conclusion
605
25 Action Mailer
607
25.1 Sending E-mail
607
25.2 Receiving E-mail
618
25.3 Testing E-mail
620
26 Active Resources
623
26.1 Alternatives to Active Resource
623
26.2 Show Me the Code!
626
26.3 Relationships and Collections
629
26.4 Pulling It All Together
632
Part IV Securing and Deploying Your Application 635
27 Securing Your Rails Application
637
27.1 SQL Injection
637
27.2 Creating Records Directly from Form Parameters
640
27.3 Don't Trust id Parameters
641
27.4 Don't Expose Controller Methods
642
27.5 Cross-Site Scripting (CSS/XSS)
643
27.6 Avoid Session Fixation Attacks
646
27.7 File Uploads
646
27.8 Don't Store Sensitive Information in the Clear
647
27.9 Use SSL to Transmit Sensitive Information
648
27.10 Don't Cache Authenticated Pages
650
27.11 Knowing That It Works
650
28 Deployment and Production
651
28.1 Starting Early
651
28.2 How a Production Server Works
652
28.3 Installing Passenger
655
28.4 Worry-Free Deployment with Capistrano
657
28.5 Checking Up on a Deployed Application
661
28.6 Production Application Chores
662
28.7 Moving On to Launch and Beyond
664
Part V Appendixes 665
A Introduction to Ruby
667
A.1 Ruby Is an Object-Oriented Language
667
A.2 Ruby Names
668
A.3 Methods
669
A.4 Classes
671
A.5 Modules
673
A.6 Arrays and Hashes
674
A.7 Control Structures
675
A.8 Regular Expressions
676
A.9 Blocks and Iterators
676
A.10 Exceptions
677
A.11 Marshaling Objects
678
A.12 Interactive Ruby
678
A.13 Ruby Idioms
678
A.14 RDoc Documentation
680
B Configuration Parameters
681
B.1 Top-Level Configuration
681
B.2 Active Record Configuration
683
B.3 Action Controller Configuration
685
B.4 Action View Configuration
687
B.5 Action Mailer Configuration
687
B.6 Test Case Configuration
689
C Source Code
691
C.1 The Full Depot Application
691
D Resources
729
D.1 Online Resources
729
Index 731
Sam Ruby is a prominent software developer who has made significant contributions to the many of the Apache Software Foundation's open source projects, and to the standardization of web feeds via his involvement with the Atom web feed standard and the popular Feed Validator web service. He currently holds a Senior Technical Staff Member position in the Emerging Technologies Group of IBM. He resides in Raleigh, North Carolina. As one of the authors of the Agile Manifesto, Dave Thomas understands agility. As the author of "Programming Ruby", he understands Ruby and how to describe Ruby applications. David Heinemeier Hansson is the creator of the Rails framework.