RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: javascript x
Testing JavaScript with PhantomJS
Episode #391 – Nov 07, 2012 – 84 comments

Testing JavaScript with PhantomJS

PhantomJS allows us to test JavaScript without going through a browser window. Here I show how to do this using Capybara and Poltergeist. I also give some tips on handling database transactions and skipping javascript tests. (10 minutes)
Running JavaScript in Ruby
Episode #297 – Nov 07, 2011 – 47 comments

Running JavaScript in Ruby

Sometimes logic needs to be shared between the server-side (Ruby) and the client-side (JavaScript). Here I show how to run JavaScript directly in Ruby through ExecJS and therubyracer. (14 minutes)
Passing Data to JavaScript
Episode #324 – Feb 13, 2012 – 77 comments

Passing Data to JavaScript

There are a variety of ways to pass variables from a Rails application to JavaScript. Here I show three techniques: a script tag, a data attribute, and the Gon gem. (6 minutes)
Testing JavaScript with Jasmine (revised)
Episode #261 – Jun 28, 2012 – 66 comments

Testing JavaScript with Jasmine (revised)

The jasminerice gem makes it easy to test your JavaScript with Jasmine in a Rails application. Here I also cover jasmine-jquery and guard-jasmine. (11 minutes)
Destroy without JavaScript (revised)
Episode #77 – Jun 16, 2012 – 48 comments

Destroy without JavaScript (revised)

A destroy link in Rails does not work without JavaScript. In this episode I show two techniques for gracefully degrading destroy links: button_to and a delete action. (8 minutes)
Unobtrusive Javascript
Episode #205 – Mar 15, 2010 – 84 comments

Unobtrusive Javascript

Keep JavaScript out of your HTML content with unobtrusive JavaScript. Here I show how Rails 3 works with this best practice. (13 minutes)
Ember Part 1
Episode #408 – Mar 04, 2013 – 161 comments

Ember Part 1

Ember.js is a javascript framework for making rich client-side applications. In the first part of this two part series I show how to setup templates, controllers, and routes. (15 minutes)
Nested Model Form (revised)
Episode #196 – Apr 19, 2012 – 228 comments

Nested Model Form (revised)

Handling multiple models in a single form is easy with accepts_nested_attributes_for. Here you will also learn how to add and remove nested records through JavaScript. (11 minutes)
Site-Wide Announcements (revised)
Episode #103 – Nov 12, 2012 – 95 comments

Site-Wide Announcements (revised)

Here I show how to add an announcement message at the top of every page in the application and allow the user to permanently hide it. This is all done test-first and even includes testing the JavaScript behavior. (11 minutes)
Testing JavaScript with Jasmine
Episode #261 – Apr 11, 2011 – 44 comments

Testing JavaScript with Jasmine

Are you testing your JavaScript? Learn how to add specs using Jasmine. This episode also covers jQuery integration with jasmine-jquery. (15 minutes)