Skip to content

Instantly share code, notes, and snippets.

@JeffCohen
Created September 1, 2011 16:19
Show Gist options
  • Save JeffCohen/1186552 to your computer and use it in GitHub Desktop.
Save JeffCohen/1186552 to your computer and use it in GitHub Desktop.
Notes on how to turn off the Rails 3.1 asset pipeline

This is a draft. I'm still learning, so this information could be completely wrong.

Avoiding the Asset Pipeline

Option 1. Avoiding it in Production Only

  1. Disable assets in production.rb
  2. Create public/stylesheets and public/javascripts folders, and put your css and js files there
  3. Modify application.html.erb to reference your own files instead of the generated "application.css" and "application.js"
  4. (Optional) Specify the --no-assets option when using the scaffold and controller generators
  5. (Optional) Try to ignore all the app/assets noise without going crazy.

Option 2. Avoiding it Entirely

  1. Generate your app without the dependency on sprockets

rails new sandbox --skip-sprockets

  1. Remove (or comment out) the :assets group in the Gemfile

group :assets do

gem 'sass-rails', " ~> 3.1.0"

gem 'coffee-rails', "~> 3.1.0"

gem 'uglifier'

end

Then do steps 1-5 above as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment