Ruby on rails 2.3 tutorial learn rails by example


Michael Hartl
Bok Engelsk 2010 · Electronic books.
Omfang
1 online resource (xvii, 536p.) : : ill.
Utgave
1st edition
Opplysninger
Bibliographic Level Mode of Issuance: Monograph. - Cover -- Contents -- Acknowledgments -- About this Book -- About the Author -- Chapter 1 From Zero to Deploy -- 1.1 Introduction -- 1.1.1 Comments for Various Readers -- 1.1.2 "Scaling" Rails -- 1.1.3 Conventions in This Book -- 1.2 Up and Running -- 1.2.1 Development Environments -- 1.2.2 Ruby, RubyGems, and Rails -- 1.2.3 The First Application -- 1.2.4 Model-View-Controller (MVC) -- 1.2.5 Script/Server -- 1.3 Version Control with Git -- 1.3.1 Installation and Setup -- 1.3.2 Adding and Committing -- 1.3.3 What Good Does Git Do You? -- 1.3.4 GitHub -- 1.3.5 Branch, Edit, Commit, Merge -- 1.4 Deploying -- 1.4.1 Heroku Setup -- 1.4.2 Heroku Deployment, Step One -- 1.4.3 Heroku Deployment, Step Two -- 1.4.4 Heroku Commands -- 1.5 Conclusion -- Chapter 2 A Demo App -- 2.1 Planning the Application -- 2.1.1 Modeling Users -- 2.1.2 Modeling Microposts -- 2.2 The Users Resource -- 2.2.1 A User Tour -- 2.2.2 MVC in Action -- 2.2.3 Weaknesses of This Users Resource -- 2.3 The Microposts Resource -- 2.3.1 A Micropost Microtour -- 2.3.2 Putting the Micro in Microposts -- 2.3.3 A User has_many Microposts -- 2.3.4 Inheritance Hierarchies -- 2.3.5 Deploying the Demo App -- 2.4 Conclusion -- Chapter 3 Mostly Static Pages -- 3.1 Static Pages -- 3.1.1 Truly Static Pages -- 3.1.2 Static Pages with Rails -- 3.2 Our First Tests -- 3.2.1 Testing Tools -- 3.2.2 TDD: Red, Green, Refactor -- 3.3 Slightly Dynamic Pages -- 3.3.1 Testing a Title Change -- 3.3.2 Passing Title Tests -- 3.3.3 Instance Variables and Embedded Ruby -- 3.3.4 Eliminating Duplication with Layouts -- 3.4 Conclusion -- 3.5 Exercises -- Chapter 4 Rails-Flavored Ruby -- 4.1 Motivation -- 4.1.1 A title Helper -- 4.1.2 Cascading Style Sheets -- 4.2 Strings and Methods -- 4.2.1 Comments -- 4.2.2 Strings -- 4.2.3 Objects and Message Passing -- 4.2.4 Method Definitions -- 4.2.5 Back to the title Helper.. - 4.3 Other Data Structures -- 4.3.1 Arrays and Ranges -- 4.3.2 Blocks -- 4.3.3 Hashes and Symbols -- 4.3.4 CSS Revisited -- 4.4 Ruby Classes -- 4.4.1 Constructors -- 4.4.2 Class Inheritance -- 4.4.3 Modifying Built-In Classes -- 4.4.4 A Controller Class -- 4.4.5 A User Class -- 4.5 Exercises -- Chapter 5 Filling in the Layout -- 5.1 Adding Some Structure -- 5.1.1 Site Navigation -- 5.1.2 Custom CSS -- 5.1.3 Partials -- 5.2 Layout Links -- 5.2.1 Integration Tests -- 5.2.2 Rails Routes -- 5.2.3 Named Routes -- 5.3 User Signup: A First Step -- 5.3.1 Users Controller -- 5.3.2 Signup URL -- 5.4 Conclusion -- 5.5 Exercises -- Chapter 6 Modeling and Viewing Users, Part I -- 6.1 User Model -- 6.1.1 Database Migrations -- 6.1.2 The Model File -- 6.1.3 Creating User Objects -- 6.1.4 Finding User Objects -- 6.1.5 Updating User Objects -- 6.2 User Validations -- 6.2.1 Validating Presence -- 6.2.2 Length Validation -- 6.2.3 Format Validation -- 6.2.4 Uniqueness Validation -- 6.3 Viewing Users -- 6.3.1 Debug and Rails Environments -- 6.3.2 User Model, View, Controller -- 6.3.3 A Users Resource -- 6.4 Conclusion -- 6.5 Exercises -- Chapter 7 Modeling and Viewing Users, Part II -- 7.1 Insecure Passwords -- 7.1.1 Password Validations -- 7.1.2 A Password Migration -- 7.1.3 An Active Record Callback -- 7.2 Secure Passwords -- 7.2.1 A Secure Password Test -- 7.2.2 Some Secure Password Theory -- 7.2.3 Implementing has_password? -- 7.2.4 An Authenticate Method -- 7.3 Better User Views -- 7.3.1 Testing the User Show Page (With Factories) -- 7.3.2 A Name and a Gravatar -- 7.3.3 A User Sidebar -- 7.4 Conclusion -- 7.4.1 Git Commit -- 7.4.2 Heroku Deploy -- 7.5 Exercises -- Chapter 8 Sign Up -- 8.1 Signup Form -- 8.1.1 Using form_for -- 8.1.2 The Form HTML -- 8.2 Signup Failure -- 8.2.1 Testing Failure -- 8.2.2 A Working Form -- 8.2.3 Signup Error Messages.. - 8.2.4 Filtering Parameter Logging -- 8.3 Signup Success -- 8.3.1 Testing Success -- 8.3.2 The Finished Signup Form -- 8.3.3 The Flash -- 8.3.4 The First Signup -- 8.4 RSpec Integration Tests -- 8.4.1 Webrat -- 8.4.2 Users Signup Failure Should Not Make a New User -- 8.4.3 Users Signup Success Should Make a New User -- 8.5 Conclusion -- 8.6 Exercises -- Chapter 9 Sign In, Sign Out -- 9.1 Sessions -- 9.1.1 Sessions Controller -- 9.1.2 Signin Form -- 9.2 Signin Failure -- 9.2.1 Reviewing Form Submission -- 9.2.2 Failed Signin (Test and Code) -- 9.3 Signin Success -- 9.3.1 The Completed create Action -- 9.3.2 Remember Me -- 9.3.3 Cookies -- 9.3.4 Current User -- 9.4 Signing Out -- 9.4.1 Destroying Sessions -- 9.4.2 Signin Upon Signup -- 9.4.3 Changing the Layout Links -- 9.4.4 Signin/out Integration Tests -- 9.5 Conclusion -- 9.6 Exercises -- Chapter 10 Updating, Showing, and Deleting Users -- 10.1 Updating Users -- 10.1.1 Edit Form -- 10.1.2 Enabling Edits -- 10.2 Protecting Pages -- 10.2.1 Requiring Signed-In Users -- 10.2.2 Requiring the Right User -- 10.2.3 An Expectation Bonus -- 10.2.4 Friendly Forwarding -- 10.3 Showing Users -- 10.3.1 User Index -- 10.3.2 Sample Users -- 10.3.3 Pagination -- 10.3.4 Partial Refactoring -- 10.4 Destroying Users -- 10.4.1 Administrative Users -- 10.4.2 The destroy Action -- 10.5 Conclusion -- 10.6 Exercises -- Chapter 11 User Microposts -- 11.1 A Micropost Model -- 11.1.1 The Basic Model -- 11.1.2 User/Micropost Associations -- 11.1.3 Micropost Refinements -- 11.1.4 Micropost Validations -- 11.2 Showing Microposts -- 11.2.1 Augmenting the User Show Page -- 11.2.2 Sample Microposts -- 11.3 Manipulating Microposts -- 11.3.1 Access Control -- 11.3.2 Creating Microposts -- 11.3.3 A Proto-Feed -- 11.3.4 Destroying Microposts -- 11.3.5 Testing the New Home Page -- 11.4 Conclusion -- 11.5 Exercises.. - Chapter 12 Following Users -- 12.1 The Relationship Model -- 12.1.1 A Problem with the Data Model (and a Solution) -- 12.1.2 User/Relationship Associations -- 12.1.3 Validations -- 12.1.4 Following -- 12.1.5 Followers -- 12.2 A Web Interface for Following and Followers -- 12.2.1 Sample Following Data -- 12.2.2 Stats and a Follow Form -- 12.2.3 Following and Followers Pages -- 12.2.4 A Working Follow Button the Standard Way -- 12.2.5 A Working Follow Button with Ajax -- 12.3 The Status Feed -- 12.3.1 Motivation and Strategy -- 12.3.2 A First Feed Implementation -- 12.3.3 Scopes, Subselects, and a Lambda -- 12.3.4 The New Status Feed -- 12.4 Conclusion -- 12.4.1 Extensions to the Sample Application -- 12.4.2 Guide to Further Resources -- 12.5 Exercises -- Index.. - The Ruby on Rails 2.3 Tutorial teaches web development with Ruby on Rails, an open-source web framework that powers many of the web's top sites, including Twitter, Hulu, and the Yellow Pages. Ruby on Rails 2.3 Tutorial helps you learn Rails by example through the development of a substantial sample application, including a site layout, a user data model, a full registration and authentication system, user-status associations, social "following," and a feed of status updates. Ruby on Rails 2.3 Tutorial also teaches good software development practices, including version control with Git and GitHub, test-driven development with RSpec, and instant deployment with Heroku. Though of necessity the book focuses on a specific sample application, the emphasis throughout this book is on general principles, so you will have a solid foundation no matter what kind of web application you want to build.
Emner
Sjanger
ISBN
1-282-88728-9. - 9786612887284
Hylleplass
TK5105.8885.R837 H37 2011

Bibliotek som har denne