Rails on Maui

Programming in Paradise

Ember.js Hello World

TLDR

  1. Tom Dale’s Intro Tutorial Video on EmberJs is awesome.
  2. Git repos of the start and the finish of the Tom Dale EmberJsTutorial.
  3. Tips for reproducing it.
  4. Screencast of me explaining the completed example.

Details

Ember.js is really amazing. The place to start is Tom Dale’s Intro Tutorial Video (on Youtube). In the 30 minute video you build the app shown here in this iframe. Some of the features you’ll learn include:

  1. Basic setup for an Ember.js app.
  2. Nested views. You can click on the articles on the left, and see the articles on the right.
  3. Ember helpers which provide markdown and date conversion with a tiny bit of code.
  4. Even how to do a read/write REST interface.

If a picture is worth a thousand words, here’s what you build in the video (you can try in the iframe below or a separate tab). The dynamic mvc nature of the bindings is neat. Try this:

  1. Click on the article “Octopress” on the left.
  2. Click Edit, change the markdown in the 2nd field, and see it change below dynamically!

Testing Error Handling

How do ensure that your application properly handles errors, especially when relying on third parties, such as payment processors? Is it easy to verify that the right things happen when the wrong things happen? Last week’s article Strategies for Rails Logging and Error Handling discussed some techniques to setup a good error handling strategy. Here’s some techniques to verify that your application does what you expect it to do when things go wrong. The key message is to check how your application handles errors, before your customers do.

Strategies for Rails Logging and Error Handling

TLDR: Clean logging and error handling is a critical aspect of a RoR app. What’s a good strategy? Why does this matter?

A Rails app can have awesome unit and functional tests, and then in production, something goes wrong and the right error handling does not happen, making a bad situation worse. By this, I mean, it’s bad enough that something went wrong in production. It’s even worse if:

  1. You don’t have clear log messages that identify exactly what went wrong.
  2. You didn’t get automatically notified via email that something went wrong. Instead, the customer told the customer service rep that there’s an issue. Ideally, when an error happens, the responsible developers should be notified.

Here’s some tips on logging setup and error handling, including a utility method to log the stack trace and send an email.

The next article, Testing Error Handling, will show you how to verify that your error handling strategy is properly implemented, includind with rspec tests.

Buy Apple Products With American Express

Here’s a few tips on buying Apple gear and credit card extended warranties. The bottom line is:

  • Consider buying AppleCare with American Express to get an extended warranty that extends 12 months past AppleCare’s 3 years. That’s 4 years total! Visa and MasterCard do not extend AppleCare’s 3 years.
  • If you don’t need AppleCare, then try to buy with American Express, as you know you’ll still get an extra 12 months. Visa or MasterCard may or may not offer a warranty extension depending on your card.
  • Avoid buying AppleCare with a Visa or MasterCard if the card already has a warranty extension. You would get 24 months of basic coverage (one year original plus one year card). For the price of AppleCare, you get only an extra 12 months, although some will want the telephone question coverage of AppleCare.