Teach Me To Code Screencasts

Many to Many Associations in Ruby on Rails – A Teach Me To Code Tutorial

I had several requests in UserVoice to provide a Many to Many tutorial in Rails. This is a demonstration of how to put together a "has and belongs to many" association and a "has many through" association. This is somewhat basic to Ruby on Rails, but important if you need to associate different models. Download…

Read More

Acceptance Tests with RSpec and Capybara

On the Ruby Rogues podcast I mentioned that I had moved away from Cucumber to RSpec and Capybara for my integration tests. Here’s a demo on how to do some TDD with RSpec and Capybara. Download 180.6 MB Download iPhone & iPod 109.2 MB

Read More

CoffeeScript: The Cool Parts

CoffeeScript offers more than nice syntax for setting and managing data and functions. It also offers Classes, Inheritance, access to a ‘super’ method, Ruby-style string interpolation, easy variable and function bindings, and chained comparisons. Here’s the code I showed in the video: class Vehicle constructor: (@name) -> move: (miles) -> console.log @name + " drove…

Read More

Rails 3.1 Beta – Sprockets, CoffeeScript, and JQuery – A Teach Me To Code Tutorial

  Ruby on Rails 3.1 is moving to use Sprockets to compile CoffeeScript into JavaScript and include JQuery in it’s JavaScript by default. This is a quick demo of how it all hangs together to manage your JavaScript in Rails 3.1. Download 65.7 MB Download (iPod & iPhone) 41.4 MB

Read More

CoffeeScript Basics – A Teach Me To Code Tutorial

CoffeeScript is now going to be a default installation with Ruby on Rails. So, I installed CoffeeScript and NodeJS and have been playing with it for the last hour or so. Here are the basics you need to know to use CoffeeScript including functions, arrays, hashes (objects), control functions (if, else, unless) and loops. In…

Read More

Single Table Inheritance – Ruby on Rails Tutorial

  Single Table Inheritance is a great way to handle related models that descend from the same class. The classic example is a Car class with Ford, Chevy, and Honda subclasses. This Ruby on Rails Tutorial provides an example and explains how Rails puts all of the information in the same database table and allows…

Read More

Compass, SASS, and the 960 Grid System – Delicious Clone

In preparing to show off SASS, I found the Compass system, which uses SASS and organizes your stylesheets in a unique way. In this tutorial, I walk you though installing compass, installing the 960 grid system, and organizing your SASS stylesheets in an intelligent way. One note, I couldn’t remember the URL for the 960…

Read More

Creating a Rake Task to Convert ERB to HAML

This is a basic demonstration of adding a rake task to Ruby on Rails. Some of the same principles apply to Rake in general. You also see how to call out to the command line and how to convert ERB and HTML to HAML. Download 51.9 MB Download (iPod & iPhone) 30.8 MB

Read More

Creating Bookmarks – Delicious Clone

  This is a basic implementation of creating bookmarks for our delicious clone using the Rails built in REST. I also found out that you need the haml-rails gem in order to get your views to generate in HAML. Download 255.3 MB Download (iPhone & iPod) 119.2 MB

Read More

CanCan: Setting Permissions – Delicious Clone

In this installment in the Delicious Clone, we use CanCan to set some permissions on the Bookmarks Controller. Next week, we’ll finish the bookmark creation process and the following, we’ll add styling with SASS. Download 133.9 MB Download (iPhone & iPod) 55.9 MB

Read More

Faster Testing with Parallel Tests

Run your tests faster with parallel_tests gem using all the cores you have on your computer. Download Download (iPhone & iPod)

Read More

Switching to HAML – Delicious Clone

This is a quick demonstration of how to switch your Rails 3 application to HAML from ERB.

Read More