Ruby on Rails Tutorial LiveLessons, 6th Edition

Ruby on Rails Tutorial LiveLessons, 6th Edition

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 20h 24m | 4.74 GB

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.

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.

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

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.

Table of Contents

1 Ruby on Rails 6 – Introduction
2 Topics
3 1.0 Introduction
4 1.1 Up and Running
5 1.1.1 Development Environment
6 1.1.2 Installing Rails
7 1.2 The First Application
8 1.2.1 Bundler
9 1.2.2 Rails Server
10 1.2.3 Model-View-Controller (MVC)
11 1.2.4 Hello, World!
12 1.3 Version Control with Git
13 1.3.1 Installation and Setup
14 1.3.2 What Good Does Git Do You
15 1.3.3 GitHub
16 1.3.4 Branch, Edit, Commit, Merge
17 1.4 Deploying
18 1.4.1 Heroku Setup and Deployment
19 1.4.2 Heroku Commands
20 1.5 Conclusion
21 Topics
22 2.0 Introduction
23 2.1 Planning the Application
24 2.1.1 A Toy Model for Users
25 2.1.2 A Toy Model for Microposts
26 2.2 The Users Resource
27 2.2.1 A User Tour
28 2.2.2 MVC in Action
29 2.2.3 Weaknesses of This Users Resource
30 2.3 The Microposts Resource
31 2.3.1 A Micropost Microtour
32 2.3.2 Putting the Micro in Microposts.
33 2.3.3 A User Has_Many Microposts
34 2.3.4 Inheritance Hierarchies
35 2.3.5 Deploying the Toy App
36 2.4 Conclusion
37 Topics
38 3.0 Introduction
39 3.1 Sample App Setup
40 3.2 Static Pages
41 3.2.1 Generated Static Pages
42 3.2.2 Custom Static Pages
43 3.3 Getting Started with Testing
44 3.3.1 Our First Test
45 3.3.2 Red
46 3.3.3 Green
47 3.3.4 Refactor
48 3.4 Slightly Dynamic Pages
49 3.4.1 Testing Titles (Red)
50 3.4.2 Adding Page Titles (Green)
51 3.4.3 Layouts and Embedded Ruby (Refactor)
52 3.4.4 Setting the Root Route
53 3.5 Conclusion
54 3.6 Advanced Testing Setup
55 3.6.1 Minitest Reporters
56 3.6.2 Automated Tests with Guard
57 Topics
58 4.0 Introduction
59 4.1 Motivation
60 4.1.1 Built-In Helpers
61 4.1.2 Custom Helpers
62 4.2 Strings and Methods
63 4.2.1 Strings
64 4.2.2 Objects and Message Passing
65 4.2.3 Method Definitions
66 4.2.4 Back to the Title Helper
67 4.3 Other Data Structures
68 4.3.1 Arrays and Ranges
69 4.3.2 Blocks
70 4.3.3 Hashes and Symbols
71 4.3.4 CSS Revisited
72 4.4 Ruby Classes
73 4.4.1 Constructors
74 4.4.2 Class Inheritance
75 4.4.3 Modifying Built-in Classes
76 4.4.4 A Controller Class
77 4.4.5 A User Class
78 4.5 Conclusion
79 Topics
80 5.0 Introduction
81 5.1 Adding Some Structure
82 5.1.1 Site Navigation
83 5.1.2 Bootstrap and Custom CSS
84 5.1.3 Partials
85 5.2 Sass and the Asset Pipeline
86 5.2.1 The Asset Pipeline
87 5.2.2 Syntactically Awesome Stylesheets
88 5.3 Layout Links
89 5.3.1 Contact Page
90 5.3.2 Rails Routes
91 5.3.3 Using Named Routes
92 5.3.4 Layout Link Tests
93 5.4 User Signup – A Frst Step
94 5.4.1 Users Controller
95 5.4.2 Signup URL
96 5.5 Conclusion
97 Topics
98 6.0 Introduction
99 6.1 User Model
100 6.1.1 Database Migrations
101 6.1.2 The Model Fle
102 6.1.3 Creating User Objects
103 6.1.4 Finding User Objects
104 6.1.5 Updating User Objects
105 6.2 User Validations
106 6.2.1 A Validity Test
107 6.2.2 Validating Presence
108 6.2.3 Length Validation
109 6.2.4 Format Validation
110 6.2.5 Uniqueness Validation
111 6.3 Adding a Secure Password
112 6.3.1 A Hashed Password
113 6.3.2 User Has Secure Password
114 6.3.3 Minimum Password Standards
115 6.3.4 Creating and Authenticating a User
116 6.4 Conclusion
117 Topics
118 7.0 Introduction
119 7.1 Showing Users
120 7.1.1 Debug and Rails Environments
121 7.1.2 A Users Resource
122 7.1.3 Debugger
123 7.1.4 A Gravatar Image and a Sidebar
124 7.2 Signup Form
125 7.2.1 Using Form_With
126 7.2.2 Signup Form HTML
127 7.3 Unsuccessful Signups
128 7.3.1 A Working Form
129 7.3.2 Strong Parameters
130 7.3.3 Signup Error Messages
131 7.3.4 A Test for Invalid Submission
132 7.4 Successful Signups
133 7.4.1 The Finished Signup Form
134 7.4.2 The Flash
135 7.4.3 The First Signup
136 7.4.4 A Test for Valid Submission
137 7.5 Professional-Grade Deployment
138 7.5.1 SSL in Production
139 7.5.2 Production Webserver
140 7.5.3 Production Database Configuration
141 7.5.4 Production Deployment
142 7.6 Conclusion
143 Topics
144 8.0 Introduction
145 8.1 Sessions
146 8.1.1 Sessions Controller
147 8.1.2 Login Form
148 8.1.3 Finding and Authenticating a User
149 8.1.4 Rendering with a Flash Message
150 8.1.5 A Flash Test
151 8.2 Logging In
152 8.2.1 The Log_In Method
153 8.2.2 Current User
154 8.2.3 Changing the Layout Links
155 8.2.4 Testing Layout Changes
156 8.2.5 Login Upon Signup
157 8.3 Logging Out
158 8.4 Conclusion
159 Topics
160 9.0 Introduction
161 9.1 Remember Me
162 9.1.1 Remember Token and Digest
163 9.1.2 Login with Remembering
164 9.1.3 Forgetting Users
165 9.1.4 Two Subtle Bugs
166 9.2 ‘Remember Me’ Checkbox
167 9.3 Remember Tests
168 9.3.1 Testing the ‘Remember Me’ Box
169 9.3.2 Testing the Remember Branch
170 9.4 Conclusion
171 Topics
172 10.0 Introduction
173 10.1 Updating Users
174 10.1.1 Edit Form
175 10.1.2 Unsuccessful Edits
176 10.1.3 Testing Unsuccessful Edits
177 10.1.4 Successful Edits (with TDD)
178 10.2 Authorization
179 10.2.1 Requiring Logged-In Users
180 10.2.2 Requiring the Right User
181 10.2.3 Friendly Forwarding
182 10.3 Showing All Users
183 10.3.1 Users Index
184 10.3.2 Sample Users
185 10.3.3 Pagination
186 10.3.4 Users Index Test
187 10.3.5 Partial Refactoring
188 10.4 Deleting Users
189 10.4.1 Administrative Users
190 10.4.2 The Destroy Action
191 10.4.3 User Destroy Tests
192 10.5 Conclusion
193 Topics
194 11.0 Introduction
195 11.1 Account Activations Resource
196 11.1.1 Account Activations Controller
197 11.1.2 Account Activation Data Model
198 11.2 Account Activation Emails
199 11.2.1 Mailer Templates
200 11.2.2 Email Previews
201 11.2.3 Email Tests
202 11.2.4 Updating the Users Create Action
203 11.3 Activating the Account
204 11.3.1 Generalizing the Authenticated Method
205 11.3.2 Activation Edit Action
206 11.3.3 Activation Test and Refactoring
207 11.4 Email in Production
208 11.5 Conclusion
209 Topics
210 12.0 Introduction
211 12.1 Password Resets Resource
212 12.1.1 Password Resets Controller
213 12.1.2 New Password Resets
214 12.1.3 Password Reset Create Action
215 12.2 Password Reset Emails
216 12.2.1 Password Reset Mailer and Templates
217 12.2.2 Email Tests
218 12.3 Resetting the Password
219 12.3.1 Reset Edit Action
220 12.3.2 Updating the Reset
221 12.3.3 Password Reset Test
222 12.4 Email in Production (Take Two)
223 12.5 Conclusion
224 Topics
225 13.0 Introduction
226 13.1 A Micropost Model
227 13.1.1 The Basic Model
228 13.1.2 Micropost Validations
229 13.1.3 User_Micropost Associations
230 13.1.4 Micropost Refinements
231 13.2 Showing Microposts
232 13.2.1 Rendering Microposts
233 13.2.2 Sample Microposts
234 13.2.3 Profile Micropost Tests
235 13.3 Manipulating Microposts
236 13.3.1 Micropost Access Control
237 13.3.2 Creating Microposts
238 13.3.3 A Proto-Feed
239 13.3.4 Destroying Microposts
240 13.3.5 Micropost Tests
241 13.4 Micropost Images
242 13.4.1 Basic Image Upload
243 13.4.2 Image Validation
244 13.4.3 Image Resizing
245 13.4.4 Image Upload in Production
246 13.5 Conclusion
247 Topics
248 14.0 Introduction
249 14.1 The Relationship Model
250 14.1.1 A Problem with the Data Model (and a Solution)
251 14.1.2 User_Relationship Associations
252 14.1.3 Relationship Validations
253 14.1.4 Followed Users
254 14.1.5 Followers
255 14.2 A Web Interface for Following Users
256 14.2.1 Sample Following Data
257 14.2.2 Stats and a Follow Form
258 14.2.3 Following and Followers Pages
259 14.2.4 A Working Follow Button the Standard Way
260 14.2.5 A Working Follow Button with Ajax
261 14.2.6 Following Tests
262 14.3 The Status Feed
263 14.3.1 Motivation and Strategy
264 14.3.2 A First Feed Implementation
265 14.3.3 Subselects
266 14.4 Conclusion
267 Ruby on Rails 6 – Summary