Ruby on Rails Tutorial – Addison Wesley – 2nd Edition

Description

Michael Hartl’s Rails Tutorial is the # 1 (and, in my opinion, the only place to start) when it comes to on Rails learning… It’s an amazing job and unusually guides you through building a Rails app from start to finish with testing. If you want to read just one and feel like a Rails master in the end, choose the Ruby on Rails™ Tutorial.

-Peter Cooper, editor, Ruby Inside “Founded in the real world”.
-I Programmer (www.i-programmer.info), by Ian Elliot “The gives you the theory and practice, while the videos focus on showing you in person how it’s done. Highly recommended combo.
-Antonio Cangiano, engineer, IBM “The author is clearly an expert in the Ruby language and the Rails framework, but more than that, he is a software who presents best practices throughout the text.”
-Greg Charles, Senior Software, Fairway Technologies “Overall, these video tutorials are a great resource for anyone new to Rails.”
-Michael Morin, ruby.about.com “I would definitely recommend this to anyone who wants to get into development”. -Michael Crump, Microsoft MVP

View more
  • Contents
    Foreword to the First Edition by Derek Sivers xv
    Foreword to the First Edition by Obie Fernandez xvii
    Acknowledgments xix
    About the Author xxi
    Chapter 1 From Zero to Deploy 1
    1.1 Introduction 3
    1.1.1 Comments for Various Readers 4
    1.1.2 ‘‘Scaling’’ Rails 7
    1.1.3 Conventions in This Book 7
    1.2 Up and Running 9
    1.2.1 Development Environments 10
    1.2.2 Ruby, RubyGems, Rails, and Git 12
    1.2.3 The First Application 17
    1.2.4 Bundler 19
    1.2.5 rails server 23
    1.2.6 Model-view-controller (MVC) 25
    1.3 Version Control with Git 27
    1.3.1 Installation and Setup 27
    1.3.2 Adding and Committing 30
    1.3.3 What Good Does Git Do You? 31
    1.3.4 GitHub 32
    1.3.5 Branch, Edit, Commit, Merge 34
    1.4 Deploying 39
    1.4.1 Heroku Setup 39
    1.4.2 Heroku Deployment, Step One 40
    1.4.3 Heroku Deployment, Step Two 40
    1.4.4 Heroku Commands 41
    1.5 Conclusion 43
    Chapter 2 A Demo App 45
    2.1 Planning the Application 45
    2.1.1 Modeling Demo Users 47
    2.1.2 Modeling Demo Microposts 48
    2.2 The Users Resource 49
    2.2.1 A User Tour 51
    2.2.2 MVC in Action 56
    2.2.3 Weaknesses of this Users Resource 62
    2.3 The Microposts Resource 63
    2.3.1 A Micropost Microtour 63
    2.3.2 Putting the micro in Microposts 66
    2.3.3 A User has many Microposts 68
    2.3.4 Inheritance Hierarchies 70
    2.3.5 Deploying the Demo App 73
    2.4 Conclusion 74
    Chapter 3 Mostly Static Pages 77
    3.1 Static Pages 82
    3.1.1 Truly Static Pages 82
    3.1.2 Static Pages with Rails 85
    3.2 Our First Tests 93
    3.2.1 Test-driven Development 93
    3.2.2 Adding a Page 99
    3.3 Slightly Dynamic Pages 103
    3.3.1 Testing a Title Change 103
    3.3.2 Passing Title Tests 106
    3.3.3 Embedded Ruby 108
    3.3.4 Eliminating Duplication with Layouts 111
    3.4 Conclusion 114
    3.5 Exercises 114
    3.6 Advanced Setup 117
    3.6.1 Eliminating bundle exec 118
    3.6.2 Automated Tests with Guard 120
    3.6.3 Speeding up Tests with Spork 123
    3.6.4 Tests inside Sublime Text 127
    Chapter 4 Rails-Flavored Ruby 129
    4.1 Motivation 129
    4.2 Strings and Methods 134
    4.2.1 Comments 134
    4.2.2 Strings 135
    4.2.3 Objects and Message Passing 138
    4.2.4 Method Definitions 141
    4.2.5 Back to the Title Helper 142
    4.3 Other Data Structures 142
    4.3.1 Arrays and Ranges 142
    4.3.2 Blocks 146
    4.3.3 Hashes and Symbols 148
    4.3.4 CSS revisited 152
    4.4 Ruby Classes 153
    4.4.1 Constructors 153
    4.4.2 Class Inheritance 155
    4.4.3 Modifying Built-in Classes 158
    4.4.4 A Controller Class 159
    4.4.5 A User Class 161
    4.5 Conclusion 164
    4.6 Exercises 164
    Chapter 5 Filling in the Layout 167
    5.1 Adding Some Structure 167
    5.1.1 Site Navigation 169
    5.1.2 Bootstrap and Custom CSS 175
    5.1.3 Partials 181
    5.2 Sass and the Asset Pipeline 187
    5.2.1 The Asset Pipeline 187
    5.2.2 Syntactically Awesome Stylesheets 190
    5.3 Layout Links 197
    5.3.1 Route Tests 200
    5.3.2 Rails Routes 202
    5.3.3 Named Routes 205
    5.3.4 Pretty RSpec 207
    5.4 User Signup: A First Step 211
    5.4.1 Users Controller 212
    5.4.2 Signup URI 213
    5.5 Conclusion 215
    5.6 Exercises 217
    Chapter 6 Modeling Users 221
    6.1 User Model 222
    6.1.1 Database Migrations 223
    6.1.2 The Model File 228
    6.1.3 Creating User Objects 230
    6.1.4 Finding User Objects 233
    6.1.5 Updating User Objects 235
    6.2 User Validations 236
    6.2.1 Initial User Tests 236
    6.2.2 Validating Presence 239
    6.2.3 Length Validation 243
    6.2.4 Format Validation 245
    6.2.5 Uniqueness Validation 249
    6.3 Adding a Secure Password 254
    6.3.1 An Encrypted Password 255
    6.3.2 Password and Confirmation 257
    6.3.3 User Authentication 260
    6.3.4 User Has Secure Password 263
    6.3.5 Creating a User 265
    6.4 Conclusion 267
    6.5 Exercises 268
    Chapter 7 Sign Up 271
    7.1 Showing Users 271
    7.1.1 Debug and Rails Environments 272
    7.1.2 A Users Resource 278
    7.1.3 Testing the User Show Page (with Factories) 282
    7.1.4 A Gravatar Image and a Sidebar 286
    7.2 Signup Form 292
    7.2.1 Tests for User Signup 293
    7.2.2 Using form for 297
    7.2.3 The Form HTML 301
    7.3 Signup Failure 303
    7.3.1 A Working Form 303
    7.3.2 Signup Error Messages 308
    7.4 Signup Success 312
    7.4.1 The Finished Signup Form 313
    7.4.2 The Flash 315
    7.4.3 The First Signup 317
    7.4.4 Deploying to Production with SSL 317
    7.5 Conclusion 321
    7.6 Exercises 321
    Chapter 8 Sign In, Sign Out 325
    8.1 Sessions and Signin Failure 325
    8.1.1 Sessions Controller 326
    8.1.2 Signin Tests 330
    8.1.3 Signin Form 333
    8.1.4 Reviewing Form Submission 336
    8.1.5 Rendering with a Flash Message 339
    8.2 Signin Success 343
    8.2.1 Remember Me 343
    8.2.2 A Working sign in Method 349
    8.2.3 Current User 351
    8.2.4 Changing the Layout Links 355
    8.2.5 Signin upon Signup 359
    8.2.6 Signing Out 361
    8.3 Introduction to Cucumber (Optional) 363
    8.3.1 Installation and Setup 364
    8.3.2 Features and Steps 365
    8.3.3 Counterpoint: RSpec Custom Matchers 368
    8.4 Conclusion 371
    8.5 Exercises 372
    Chapter 9 Updating, Showing, and Deleting Users 373
    9.1 Updating Users 373
    9.1.1 Edit Form 374
    9.1.2 Unsuccessful Edits 380
    9.1.3 Successful Edits 382
    9.2 Authorization 385
    9.2.1 Requiring Signed-in Users 386
    9.2.2 Requiring the Right User 390
    9.2.3 Friendly Forwarding 392
    9.3 Showing All Users 396
    9.3.1 User Index 396
    9.3.2 Sample Users 403
    9.3.3 Pagination 404
    9.3.4 Partial Refactoring 410
    9.4 Deleting Users 413
    9.4.1 Administrative Users 413
    9.4.2 The destroy Action 417
    9.5 Conclusion 422
    9.6 Exercises 424
    Chapter 10 User Microposts 429
    10.1 A Micropost Model 429
    10.1.1 The Basic Model 430
    10.1.2 Accessible Attributes and the First Validation 432
    10.1.3 User/Micropost Associations 433
    10.1.4 Micropost Refinements 439
    10.1.5 Content Validations 443
    10.2 Showing Microposts 445
    10.2.1 Augmenting the User Show Page 446
    10.2.2 Sample Microposts 450
    10.3 Manipulating Microposts 454
    10.3.1 Access Control 456
    10.3.2 Creating Microposts 459
    10.3.3 A Proto-feed 467
    10.3.4 Destroying Microposts 475
    10.4 Conclusion 479
    10.5 Exercises 480
    Chapter 11 Following Users 483
    11.1 The Relationship Model 484
    11.1.1 A Problem with the Data Model (and a Solution) 485
    11.1.2 User/Relationship Associations 491
    11.1.3 Validations 495
    11.1.4 Followed users 495
    11.1.5 Followers 500
    11.2 A Web Interface for Following Users 503
    11.2.1 Sample Following Data 503
    11.2.2 Stats and a Follow Form 505
    11.2.3 Following and Followers Pages 515
    11.2.4 A Working Follow Button the Standard Way 519
    11.2.5 A Working Follow Button with Ajax 524
    11.3 The Status Feed 529
    11.3.1 Motivation and Strategy 530
    11.3.2 A First Feed Implementation 532
    11.3.3 Subselects 535
    11.3.4 The New Status Feed 538
    11.4 Conclusion 539
    11.4.1 Extensions to the Sample Application 540
    11.4.2 Guide to Further Resources 542
    11.5 Exercises 543
    Index 545
  • Citation
    • Full Title: Ruby on Rails Tutorial
    • Author/s:
    • ISBN-10: 0321832051
    • ISBN-13: 9780321832054
    • Edition: 2nd Edition
    • Publication date: 2012
    • Topic: Computer
    • Subtopic: Web Development
    • File Type: eBook
    • Idioma: English

Download now Ruby on Rails Tutorial

Type of file
Language
Download RAR
Download PDF
Pages
File size
Book
English
--
--
--

Leave us a comment

No Comments

guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x