railscasts.com Archives - 26 June 2013, Wednesday

The application’s CSS file now requires a foundation_and_overrides file that was created by the generator. This loads in the Foundation framework and allows us to customize it by setting variables. We won’t show this file here as it’s very long, although most of it is comments showing...

Related:

Check your PATH (export PATH) in .zshrc and remove all references to .rvm within it. You should end up with something like this export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/texbin When installing oh-my-zsh it will look at yo...

ZURB's Foundation is a front-end for quickly building applications and prototypes. It is similar to Twitter Bootstrap but uses Sass instead of LESS. Here you will learn the basics of the grid system, navigation, tooltips and more.

Related:

#416 Form Objects pro Jun 03, 2013 | 18 minutes | Refactoring , Forms Models have a tendency to become a complex mess as an application grows. In this episode you will learn a couple of techniques to extract form-behavior out into its own class. Subscribe to Watch Episode Tweet Show N...

Related:

In this episode we’ll take a look a Draper , a gem that lets us add decorators to a Rails application’s views much like a presenter pattern. If you find that you have a lot of complex view logic in your templates and helper methods Draper can help to clean up this code by taking a mor...

#416 Form Objects pro Jun 03, 2013 | 18 minutes | Refactoring , Forms Models have a tendency to become a complex mess as an application grows. In this episode you will learn a couple of techniques to extract form-behavior out into its own class. Subscribe to Watch Episode Tweet Show N...

Related:

May 13, 2013 | 12 minutes | Performance , Active Record Caching at a low level is a great option when the view is too dynamic to cache and you need something flexible that can work anywhere in the application. Here I show a variety of ways to use Rails.cache with Active Record.

I've been in bed this past week due to a particularly bad head cold which is why there haven't been any episodes. I feel I'm on the mend now and should be able to get back to producing content later this week. Pro subscribers can extend their subscription below by one week to make up ...

# Settings specified here will take precedence over those in config/application.rb # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web server whe...

May 13, 2013 | 12 minutes | Performance , Active Record Caching at a low level is a great option when the view is too dynamic to cache and you need something flexible that can work anywhere in the application. Here I show a variety of ways to use Rails.cache with Active Record.

Apr 27, 2013 | 18 minutes | Rack , APIs Here I demonstrate how to perform bulk API operations though a single request using Rack middleware. This is great if you need to trigger multiple actions at once such as if the user goes offline.

Related:

Rails commands, such as generators, migrations, and tests, have a tendency to be slow because they need to load the Rails app each time. Here I show three tools to make this faster: Zeus, Spring, and Commands.

Good one. Under what circumstances would you recommend this over elastic search? The obvious benefit is that you don't need to install and keep up another piece of software just for indexing your content, but I'm concerned about the speed. Have anyone done a speed test between these t...

Not to be that guy, but as i usually see valid questions after the railscasts episodes, I'm wondering why Ryan doesn't seem to respond to any of them anymore. I love railscasts and have been a pro member since the beginning, but a lot of the time valid questions asked directly to Ryan...

Related:

#414 Batch API Requests pro Apr 27, 2013 | 18 minutes | Rack , APIs Here I demonstrate how to perform bulk API operations though a single request using Rack middleware. This is great if you need to trigger multiple actions at once such as if the user goes offline. Subscribe to Watch E...

Rails comes with a lot of different helper methods dealing with forms. Here's a quick tip on deciding which ones to use. If the form is editing a model, use the helper methods which do not end in the word "tag". If you aren't editing a model (such as a search form) then

Keeping passwords and secret tokens in source control is a security risk. Here I show how to move these settings out into a YAML configuration file which can be loaded in as a hash or environment variables.

Related:

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.

Related:

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!