Learn your way! Get started

Ruby on Rails, Part 2 of 5: Best Practices

with expert Jordan Hudgens

Watch trailer

Course at a glance

Included in these subscriptions:

  • Dev & IT Pro Video
  • Dev & IT Pro Power Pack

Release date 10/20/2014
Level Beginner
Runtime 1h 23m
Closed captioning Included
Transcript Included
eBooks / courseware Included
Hands-on labs N/A
Sample code Included
Exams Included

Enterprise Solutions

Need reporting, custom learning tracks, or SCORM? Learn More

Course description

To begin this course we will cover how the model view controller design pattern works in the Ruby on Rails framework, specifically discussing the rolls and best practices associated with each element. We will walk through the file system so you can become familiar with items such as the respective roles of our config directory, how the asset management sytem is structured, plus many other items, and lastly, how we utilize the Gemfile. The Ruby on Rails development stack works very closely with version control management systems such as Github and we will cover what Git is, why it is important and how to implement it into our application. Routing is one of the core fundamentals of any web application, and we will walk through how to setup a root homepage. We will finish up this course by building a scaffold into our application that interacts with our database, has form elements for the user, renders a database query on the page and is tested using RSpec.


This course teaches anyone who is interested in learning the basics of programming computers using Ruby on Rails. This course has no programming language prerequisites and only assumes basic familiarity with computer usage. Anyone with moderate computer end-user experience should be able to take this course. Please view the Ruby on Rails: Intro to Development course before taking this course.

Learning Paths

This course is part of the following LearnNowOnline SuccessPaths™:
Ruby Development

Meet the expert

Jordan Hudgens has certifications for Ruby on Rails, Thinkful; Ruby on Rails, Bloc.io; Front End Development, Thinkful; and AngularJS, Thinkful. He is currently vice president of engineering for TRACKR in Midland, Texas and is working on his PhD in Computer Science from Texas Tech. In addition to Ruby, Jordan works with PHP, JavaScript, MySQL, Postgres, CSS3, C, C++, C#, Objective-C, and Python. He also works with the frameworks Rails (Ruby), Zend (PHP), and Django (Python), plus the libraries AngularJS, jQuery, and Backbone.js.

Course outline

Best Practices

MVC (10:11)
  • Introduction (00:20)
  • Overview (02:22)
  • Model (01:51)
  • View (00:53)
  • Controller (01:38)
  • Demo: MVC (02:44)
  • Summary (00:19)
File System (20:17)
  • Introduction (00:25)
  • Config (02:32)
  • Assets (01:49)
  • Logic (00:09)
  • Layouts (00:56)
  • Database (01:32)
  • Gemfile (01:00)
  • Demo: Config Directory (02:57)
  • Demo: Asset Directory (01:37)
  • Demo: Layouts Directory (02:31)
  • Demo: Database Directory (02:53)
  • Demo: Gem File (01:38)
  • Summary (00:14)
Git (17:09)
  • Introduction (00:23)
  • Why use git? (05:07)
  • Basic commands (03:08)
  • Branching & Commands (01:48)
  • Reverting (00:48)
  • Demo: README file (04:19)
  • Demo: Revert Back (01:17)
  • Summary (00:15)
Routing (15:31)
  • Introduction (00:16)
  • Setting the homepage (01:37)
  • Resources (01:05)
  • Pages (00:56)
  • Usage in Rails (01:36)
  • Demo: Routing (02:18)
  • Demo: Homepage Control (01:02)
  • Demo: Link to (01:47)
  • Demo: Navigation Bar (03:21)
  • Demo: Git Status (01:07)
  • Summary (00:20)
Testing With Scaffolds (20:47)
  • Introduction (00:23)
  • Setting up Rspec (01:19)
  • Scaffolds (04:23)
  • Demo: Setting up Rspec (02:27)
  • Demo: Create Scaffold (01:51)
  • Demo: Start servers (02:27)
  • Demo: Adding a Tab (01:53)
  • Demo: Rspec Testing (03:17)
  • Demo: Testing Failure (02:15)
  • Summary (00:27)