railscasts.com Archives - 14 April 2013, Sunday

The cache_digests gem (also included in Rails 4) will automatically add a digest to the fragment cache key based on the template. If a template changes the cache will auto-expire. But watch out for the gotchas!

When an exception is raised in development you get the full error along with the stack trace. In production, only a simple message is displayed. Learn why this is and how to customize the handling of exceptions.

Related:

Now that we don’t have to start up our Rails application every time we run one of these commands the output appears much sooner. Zeus works by preloading Rails in the different environments, development and test, and if we had Cucumber set up in this app it would work for that as well...

Related:

Let's say you provide a select menu for setting which category a given product belongs to, but you also want the option of creating a new category by typing the name in a text field. See a great way to do that in this episode.

Upcoming Schedule Change You may have noticed the RailsCasts episode production has slowed recently. I have tried to compensate for this by providing free weeks to subscribers, however that is a temporary solution that I did not plan to use regularly. Starting May 6, 2013, I will be c...

Mar 27, 2013 | 16 minutes | Performance Learn how to add performance tests that automate benchmark and profile reports. Here I show how to find the bottlenecks to optimize a page. I also show how to compile Ruby with gcdata to get information about memory usage.

If you're a TMUX user I've found the Tmuxinator Gem to be fantastic way to setup and control multiple Rails dev environments. Starting and/or attaching to an app's session is as simple as $ mux my_app ; Adding Zues or Spring into the into Tmuxinator config is something I might try in ...

The next major version of Rails is just around the corner and as this is episode 400 it seems like a good time to discuss what’s coming in Rails 4.0. At the time of writing there’s no gem pre-release yet so to take a look at it we’ll have to check out the master branch, which we can d...

In this first part of a two part series you will learn basic Backbone concepts including models, collections, routers, views and events. The backbone-on-rails gem is used for Rails integration with the asset pipeline.

This is what the N+1 query problem is: making a query to fetch the parent then any number of child queries to fetch the other records. This kind of problem can be easy to overlook and this is where Bullet comes in useful. We’ll add it to our application’s gemfile, but only in the deve...

Mar 27, 2013 | 16 minutes | Performance Learn how to add performance tests that automate benchmark and profile reports. Here I show how to find the bottlenecks to optimize a page. I also show how to compile Ruby with gcdata to get information about memory usage.

Related:

#410 Ember Part 2 pro Mar 12, 2013 | 14 minutes | Views , Plugins , APIs Here we continue our look into Ember.js. First we add a JSON API to persist the entries through ember-data. Then we finish up the project by adding a computed property and a view object. Subscribe to Watch Episod...

The Active Model Serializer will automatically pick this up and if we move this up into the ApplicationController it’s included in all the controllers. We want to keep the route node, so we won’t add this method to our app. Instead, we’ll go back to our serializer class to see how we ...

The next Pro episode has been taking a bit longer than expected. It will be on performance testing with automated benchmarking and profiling. The current plan is to release it this Tuesday (March 26). In the meantime here's a free week to the Pro subscribers. Thanks for your support! ...

Related:

In Rails 3.1 the controller inheritance also applies to the view layer. Here I show how to add an application template which is shared by all views, and a lookup path for overriding templates based on the subdomain.