Skip to content

Instantly share code, notes, and snippets.

@ecpplus
Created September 13, 2011 17:47
Show Gist options
  • Save ecpplus/1214488 to your computer and use it in GitHub Desktop.
Save ecpplus/1214488 to your computer and use it in GitHub Desktop.
Rails3.0.x to Rails3.1.0
<%= stylesheet_link_tag 'application' %>
<%= javascript_include_tag 'application' %>
//= require jquery
//= require jquery_ujs
#Bundler.require(:default, Rails.env) if defined?(Bundler) # <- delete this
# add
if defined?(Bundler)
# 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)
end
module MyApp
class Application < Rails::Application
...
config.assets.enabled = true # add
config.assets.version = '1.0' # add
end
end
#config.action_view.debug_rjs = true # <- delete this
gem 'rails', '3.1.0'
...
# add for assets
gem 'sass'
gem 'coffee-script'
gem 'uglifier'
gem 'jquery-rails'
mkdir app/assets
mv public/javascripts app/assets
mv public/stylesheets app/assets
mv public/images app/assets
cd app/assets/javascripts && rm controls.js dragdrop.js effects.js rails.js prototype.js
config.assets.compress = true
config.assets.compile = true
config.assets.digest = true
-MyApp::Application.routes.draw do |map|
+MyApp::Application.routes.draw do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment