#282 Upgrading to Rails 3.1
It is incredibly easy to upgrade to Rails 3.1, but if you want to take advantage of the asset pipeline you will need to put in some extra effort. Have no fear because I walk you through each of the necessary steps in this episode.
- mp4Full Size H.264 Video (22.2 MB)
- m4vSmaller H.264 Video (12.7 MB)
- webmFull Size VP8 Video (14.8 MB)
- ogvFull Size Theora Video (33 MB)
gem "rails", "3.1.0"
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
# If you precompile assets before deploying to production, use this line
Bundler.require *Rails.groups(:assets => %w(development test))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
# comment out this line:
# config.action_view.debug_rjs = true
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
# Configure static asset server for tests with Cache-Control for performance
config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600"
# This config option was shown in the episode but is actually not used, so don't bother adding it.
# config.assets.allow_debugging = true
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
# Generate digests for assets URLs
config.assets.digest = true
<%= stylesheet_link_tag "application" %>
//= require jquery
//= require jquery_ujs
//= require_tree .
*= require_tree .
Don't forget to move all of your assets into app/assets and replace any static references to them with helper methods (such as