Ruby on Rails Tutorial, 6th Edition

Video description

20 Hours of Video Instruction

Ruby on Rails Tutorial LiveLessons, Sixth Edition, is the best-selling complete video training course on web development with Rails, the popular web framework for building dynamic, database-backed web applications. You learn Rails by example by building a substantial sample application from scratch.

Overview

Best-selling author and leading Rails developer Michael Hartl teaches Rails by guiding you through the development of three sample applications of increasing sophistication, focusing on the fundamental techniques in web development needed for virtually any kind of application. The updates to this edition include full compatibility with Rails 6 and numerous new exercises interspersed in each lesson for maximum reinforcement. This indispensable guide provides integrated tutorials not only for Rails, but also for the essential Ruby, HTML, CSS, and SQL skills you need when developing web applications. Hartl explains how each new technique solves a real-world problem, and then he demonstrates it with bite-sized code that’s simple enough to understand while still being useful.

About the Instructor

Michael Hartl is the creator of the Ruby on Rails Tutorial, one of the leading introductions to web development, and is cofounder and principal author at Learn Enough. Previously, he was a physics instructor at the California Institute of Technology (Caltech), where he received a Lifetime Achievement Award for Excellence in Teaching. He is a graduate of Harvard College, has a PhD in Physics from Caltech, and is an alumnus of the Y Combinator entrepreneur program.

Skill Level
  • Beginner to intermediate
Learn How To
  • Install and set up your Rails development environment
  • Utilize the optional easy start, using pre-installed IDE in the cloud
  • Build Rails applications from scratch
  • Test and use test-driven development (TDD)
  • Effectively use the Model-View-Controller (MVC) pattern
  • Structure applications using REST architecture
  • Build static pages and transform them into dynamic ones
  • Implement registration and authentication systems, including validation and secure passwords
  • Deploy your application
Who Should Take This Course
  • Developers looking for a practical introduction for building dynamic, database-backed web applications with Rails.
Course Requirements
  • No formal prerequisites, but some background in developer tools (command line, text editor) and web technologies (HTML) is helpful
  • Some Ruby background is useful but not required
Lesson Descriptions

Lesson 1: From Zero to Deploy
The first lesson teaches you how to set up an integrated development in the cloud, create a first Rails application, and deploy it to production with Git and Heroku.

Lesson 2: A Toy App
In this lesson, you get up and running quickly with a toy application that demonstrates the basic workings of a Rails application with users and short posts. It includes a focus on interacting with the toy app through its URIs (often called URLs) using a web browser. You learn how to generate dynamic web pages using the MVC pattern and structure web applications using the REST architecture.

Lesson 3: Mostly Static Pages
This lesson focuses on developing the industrial-strength sample application that is used throughout the rest of the video. You begin by creating static pages and then move on to adding a little dynamic content. After writing all the code from scratch, you’ll get your first taste of testing and test-driven development (TDD).

Lesson 4: Rails-Flavored Ruby
In this lesson, you’ll learn the basics of Ruby, the programming language underlying Rails. The focus is on the aspects of Ruby most useful for Rails development, including strings, arrays, hashes, and Ruby classes.

Lesson 5: Filling in the Layout
This lesson incorporates Twitter’s Bootstrap framework into the sample application, adds custom styles, and fills in the layout with links to the pages created so far. Topics covered include partials, Rails routes, the asset pipeline, Sass, and an introduction to end-to-end testing with integration tests.

Lesson 6: Modeling Users
This lesson demonstrates how to create a data model for the site’s users and to persist user data using a database back-end. You learn how to implement data validations and add a secure password to allow login and authentication.

Lesson 7: Sign Up
The development of the sample app continues by giving users the ability to sign up for the site and create a user profile. You also learn how to make a sign-up form with error messages for invalid submission and implement successful user registration for valid submission.

Lesson 8: Basic Login
Now that new users can sign up for the site, it's time to give them the ability to log in and log out. In this lesson, you learn how to implement the simplest fully functional login model, which keeps users logged in for one session at a time, automatically expiring the sessions when users close their browsers.

Lesson 9: Advanced Login
In this lesson, you build on the login system from Lesson 8 to add the ability to remember the users' login status even after they close their browsers. You also learn how to automatically remember users, and then how to optionally remember them based on the value of a remember-me checkbox.

Lesson 10: Updating, Showing, and Deleting Users
In this lesson, we complete the REST actions for the Users resource by adding edit, update, index, and destroy actions. We also put the login system to good use by restricting certain actions to logged-in users or administrative users.

Lesson 11: Account Activation
In Lesson 10, you finished making a basic user resource, together with the flexible authentication and authorization system. In this lesson and the next, you learn how to put the finishing touches on this system, starting with an account activation feature that verifies each new user’s email address. This will involve creating a new resource, thereby giving you a chance to see further examples of controllers, routing, and database migrations. In the process, you also learn how to send email in Rails, both in development and in production.

Lesson 12: Password Reset
In this lesson, you learn how to give users the ability to reset their passwords if they forget them. The implementation closely parallels the account activations from Lesson 11, providing yet another example of creating a Rails resource from scratch, as well as a second example of sending email in production.

Lesson 13: User Microposts
This lesson demonstrates how to make a data model for short posts (“microposts”), make a page to show a list of microposts, and implement a web interface to create and delete microposts. You then learn how to upload images and associate them to microposts, including image resizing, format validations, and production deployment using a cloud storage service (Amazon Web Services S3).

Lesson 14: Following Users
The final lesson completes the core sample application by adding a social layer for users to follow and unfollow other users. You learn how to make a data model between users, give users the capability to follow each other through the web, and create a status feed of the microposts from the users.

About Pearson Video Training
Pearson publishes expert-led video tutorials covering a wide selection of technology topics designed to teach you the skills you need to succeed. These professional and personal technology videos feature world-leading author instructors published by your trusted technology brands: Addison-Wesley, Cisco Press, Pearson IT Certification, Sams, and Que. Topics include: IT Certification, Network Security, Cisco Technology, Programming, Web Development, Mobile Development, and more. Learn more about Pearson Video training at https://www.informit.com/video.

Table of contents

  1. Introduction
    1. Ruby on Rails 6: Introduction
  2. Lesson 1: From Zero to Deploy
    1. Topics
    2. 1.0 Introduction
    3. 1.1 Up and Running
    4. 1.1.1 Development Environment
    5. 1.1.2 Installing Rails
    6. 1.2 The First Application
    7. 1.2.1 Bundler
    8. 1.2.2 Rails Server
    9. 1.2.3 Model-View-Controller (MVC)
    10. 1.2.4 Hello, World!
    11. 1.3 Version Control with Git
    12. 1.3.1 Installation and Setup
    13. 1.3.2 What Good Does Git Do You?
    14. 1.3.3 GitHub
    15. 1.3.4 Branch, Edit, Commit, Merge
    16. 1.4 Deploying
    17. 1.4.1 Heroku Setup and Deployment
    18. 1.4.2 Heroku Commands
    19. 1.5 Conclusion
  3. Lesson 2: A Toy App
    1. Topics
    2. 2.0 Introduction
    3. 2.1 Planning the Application
    4. 2.1.1 A Toy Model for Users
    5. 2.1.2 A Toy Model for Microposts
    6. 2.2 The Users Resource
    7. 2.2.1 A User Tour
    8. 2.2.2 MVC in Action
    9. 2.2.3 Weaknesses of This Users Resource
    10. 2.3 The Microposts Resource
    11. 2.3.1 A Micropost Microtour
    12. 2.3.2 Putting the Micro in Microposts.
    13. 2.3.3 A User Has_Many Microposts
    14. 2.3.4 Inheritance Hierarchies
    15. 2.3.5 Deploying the Toy App
    16. 2.4 Conclusion
  4. Lesson 3: Mostly Static Pages
    1. Topics
    2. 3.0 Introduction
    3. 3.1 Sample App Setup
    4. 3.2 Static Pages
    5. 3.2.1 Generated Static Pages
    6. 3.2.2 Custom Static Pages
    7. 3.3 Getting Started with Testing
    8. 3.3.1 Our First Test
    9. 3.3.2 Red
    10. 3.3.3 Green
    11. 3.3.4 Refactor
    12. 3.4 Slightly Dynamic Pages
    13. 3.4.1 Testing Titles (Red)
    14. 3.4.2 Adding Page Titles (Green)
    15. 3.4.3 Layouts and Embedded Ruby (Refactor)
    16. 3.4.4 Setting the Root Route
    17. 3.5 Conclusion
    18. 3.6 Advanced Testing Setup
    19. 3.6.1 Minitest Reporters
    20. 3.6.2 Automated Tests with Guard
  5. Lesson 4: Rails-flavored Ruby
    1. Topics
    2. 4.0 Introduction
    3. 4.1 Motivation
    4. 4.1.1 Built-In Helpers
    5. 4.1.2 Custom Helpers
    6. 4.2 Strings and Methods
    7. 4.2.1 Strings
    8. 4.2.2 Objects and Message Passing
    9. 4.2.3 Method Definitions
    10. 4.2.4 Back to the Title Helper
    11. 4.3 Other Data Structures
    12. 4.3.1 Arrays and Ranges
    13. 4.3.2 Blocks
    14. 4.3.3 Hashes and Symbols
    15. 4.3.4 CSS Revisited
    16. 4.4 Ruby Classes
    17. 4.4.1 Constructors
    18. 4.4.2 Class Inheritance
    19. 4.4.3 Modifying Built-in Classes
    20. 4.4.4 A Controller Class
    21. 4.4.5 A User Class
    22. 4.5 Conclusion
  6. Lesson 5: Filling in the Layout
    1. Topics
    2. 5.0 Introduction
    3. 5.1 Adding Some Structure
    4. 5.1.1 Site Navigation
    5. 5.1.2 Bootstrap and Custom CSS
    6. 5.1.3 Partials
    7. 5.2 Sass and the Asset Pipeline
    8. 5.2.1 The Asset Pipeline
    9. 5.2.2 Syntactically Awesome Stylesheets
    10. 5.3 Layout Links
    11. 5.3.1 Contact Page
    12. 5.3.2 Rails Routes
    13. 5.3.3 Using Named Routes
    14. 5.3.4 Layout Link Tests
    15. 5.4 User Signup: A Frst Step
    16. 5.4.1 Users Controller
    17. 5.4.2 Signup URL
    18. 5.5 Conclusion
  7. Lesson 6: Modeling Users
    1. Topics
    2. 6.0 Introduction
    3. 6.1 User Model
    4. 6.1.1 Database Migrations
    5. 6.1.2 The Model Fle
    6. 6.1.3 Creating User Objects
    7. 6.1.4 Finding User Objects
    8. 6.1.5 Updating User Objects
    9. 6.2 User Validations
    10. 6.2.1 A Validity Test
    11. 6.2.2 Validating Presence
    12. 6.2.3 Length Validation
    13. 6.2.4 Format Validation
    14. 6.2.5 Uniqueness Validation
    15. 6.3 Adding a Secure Password
    16. 6.3.1 A Hashed Password
    17. 6.3.2 User Has Secure Password
    18. 6.3.3 Minimum Password Standards
    19. 6.3.4 Creating and Authenticating a User
    20. 6.4 Conclusion
  8. Lesson 7: Sign Up
    1. Topics
    2. 7.0 Introduction
    3. 7.1 Showing Users
    4. 7.1.1 Debug and Rails Environments
    5. 7.1.2 A Users Resource
    6. 7.1.3 Debugger
    7. 7.1.4 A Gravatar Image and a Sidebar
    8. 7.2 Signup Form
    9. 7.2.1 Using Form_With
    10. 7.2.2 Signup Form HTML
    11. 7.3 Unsuccessful Signups
    12. 7.3.1 A Working Form
    13. 7.3.2 Strong Parameters
    14. 7.3.3 Signup Error Messages
    15. 7.3.4 A Test for Invalid Submission
    16. 7.4 Successful Signups
    17. 7.4.1 The Finished Signup Form
    18. 7.4.2 The Flash
    19. 7.4.3 The First Signup
    20. 7.4.4 A Test for Valid Submission
    21. 7.5 Professional-Grade Deployment
    22. 7.5.1 SSL in Production
    23. 7.5.2 Production Webserver
    24. 7.5.3 Production Database Configuration
    25. 7.5.4 Production Deployment
    26. 7.6 Conclusion
  9. Lesson 8: Basic Login
    1. Topics
    2. 8.0 Introduction
    3. 8.1 Sessions
    4. 8.1.1 Sessions Controller
    5. 8.1.2 Login Form
    6. 8.1.3 Finding and Authenticating a User
    7. 8.1.4 Rendering with a Flash Message
    8. 8.1.5 A Flash Test
    9. 8.2 Logging In
    10. 8.2.1 The Log_In Method
    11. 8.2.2 Current User
    12. 8.2.3 Changing the Layout Links
    13. 8.2.4 Testing Layout Changes
    14. 8.2.5 Login Upon Signup
    15. 8.3 Logging Out
    16. 8.4 Conclusion
  10. Lesson 9: Advanced Login
    1. Topics
    2. 9.0 Introduction
    3. 9.1 Remember Me
    4. 9.1.1 Remember Token and Digest
    5. 9.1.2 Login with Remembering
    6. 9.1.3 Forgetting Users
    7. 9.1.4 Two Subtle Bugs
    8. 9.2 "Remember Me" Checkbox
    9. 9.3 Remember Tests
    10. 9.3.1 Testing the "Remember Me" Box
    11. 9.3.2 Testing the Remember Branch
    12. 9.4 Conclusion
  11. Lesson 10: Updating, Showing, and Deleting Users
    1. Topics
    2. 10.0 Introduction
    3. 10.1 Updating Users
    4. 10.1.1 Edit Form
    5. 10.1.2 Unsuccessful Edits
    6. 10.1.3 Testing Unsuccessful Edits
    7. 10.1.4 Successful Edits (with TDD)
    8. 10.2 Authorization
    9. 10.2.1 Requiring Logged-In Users
    10. 10.2.2 Requiring the Right User
    11. 10.2.3 Friendly Forwarding
    12. 10.3 Showing All Users
    13. 10.3.1 Users Index
    14. 10.3.2 Sample Users
    15. 10.3.3 Pagination
    16. 10.3.4 Users Index Test
    17. 10.3.5 Partial Refactoring
    18. 10.4 Deleting Users
    19. 10.4.1 Administrative Users
    20. 10.4.2 The Destroy Action
    21. 10.4.3 User Destroy Tests
    22. 10.5 Conclusion
  12. Lesson 11: Account Activation
    1. Topics
    2. 11.0 Introduction
    3. 11.1 Account Activations Resource
    4. 11.1.1 Account Activations Controller
    5. 11.1.2 Account Activation Data Model
    6. 11.2 Account Activation Emails
    7. 11.2.1 Mailer Templates
    8. 11.2.2 Email Previews
    9. 11.2.3 Email Tests
    10. 11.2.4 Updating the Users Create Action
    11. 11.3 Activating the Account
    12. 11.3.1 Generalizing the Authenticated? Method
    13. 11.3.2 Activation Edit Action
    14. 11.3.3 Activation Test and Refactoring
    15. 11.4 Email in Production
    16. 11.5 Conclusion
  13. Lesson 12: Password Reset
    1. Topics
    2. 12.0 Introduction
    3. 12.1 Password Resets Resource
    4. 12.1.1 Password Resets Controller
    5. 12.1.2 New Password Resets
    6. 12.1.3 Password Reset Create Action
    7. 12.2 Password Reset Emails
    8. 12.2.1 Password Reset Mailer and Templates
    9. 12.2.2 Email Tests
    10. 12.3 Resetting the Password
    11. 12.3.1 Reset Edit Action
    12. 12.3.2 Updating the Reset
    13. 12.3.3 Password Reset Test
    14. 12.4 Email in Production (Take Two)
    15. 12.5 Conclusion
  14. Lesson 13: User Microposts
    1. Topics
    2. 13.0 Introduction
    3. 13.1 A Micropost Model
    4. 13.1.1 The Basic Model
    5. 13.1.2 Micropost Validations
    6. 13.1.3 User/Micropost Associations
    7. 13.1.4 Micropost Refinements
    8. 13.2 Showing Microposts
    9. 13.2.1 Rendering Microposts
    10. 13.2.2 Sample Microposts
    11. 13.2.3 Profile Micropost Tests
    12. 13.3 Manipulating Microposts
    13. 13.3.1 Micropost Access Control
    14. 13.3.2 Creating Microposts
    15. 13.3.3 A Proto-Feed
    16. 13.3.4 Destroying Microposts
    17. 13.3.5 Micropost Tests
    18. 13.4 Micropost Images
    19. 13.4.1 Basic Image Upload
    20. 13.4.2 Image Validation
    21. 13.4.3 Image Resizing
    22. 13.4.4 Image Upload in Production
    23. 13.5 Conclusion
  15. Lesson 14: Following Users
    1. Topics
    2. 14.0 Introduction
    3. 14.1 The Relationship Model
    4. 14.1.1 A Problem with the Data Model (and a Solution)
    5. 14.1.2 User/Relationship Associations
    6. 14.1.3 Relationship Validations
    7. 14.1.4 Followed Users
    8. 14.1.5 Followers
    9. 14.2 A Web Interface for Following Users
    10. 14.2.1 Sample Following Data
    11. 14.2.2 Stats and a Follow Form
    12. 14.2.3 Following and Followers Pages
    13. 14.2.4 A Working Follow Button the Standard Way
    14. 14.2.5 A Working Follow Button with Ajax
    15. 14.2.6 Following Tests
    16. 14.3 The Status Feed
    17. 14.3.1 Motivation and Strategy
    18. 14.3.2 A First Feed Implementation
    19. 14.3.3 Subselects
    20. 14.4 Conclusion
  16. Summary
    1. Ruby on Rails 6: Summary

Product information

  • Title: Ruby on Rails Tutorial, 6th Edition
  • Author(s): Michael Hartl
  • Release date: April 2020
  • Publisher(s): Pearson
  • ISBN: 0136733468