#205 Unobtrusive Javascript
Keep JavaScript out of your HTML content with unobtrusive JavaScript. Here I show how Rails 3 works with this best practice.
- Download:
- source codeProject Files in Zip (163 KB)
- mp4Full Size H.264 Video (18.8 MB)
- m4vSmaller H.264 Video (13.4 MB)
- webmFull Size VP8 Video (35 MB)
- ogvFull Size Theora Video (25.6 MB)
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)
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 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)
Turbolinks
Turbolinks can make your Rails app feel faster by using JavaScript to replace the page content when clicking a link. It will be default in new Rails 4.0 applications, but here I show how to use it in Rails 3 and mention some of the gotchas.
(7 minutes)
jQuery & Ajax (revised)
Here I go back to the basics and show how to turn a traditional Rails app into one that interacts through Ajax by adding "remote" options, JavaScript templates and a dabble of jQuery.
(14 minutes)