diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/application.rb | 12 | ||||
-rw-r--r-- | config/environments/development.rb | 7 | ||||
-rw-r--r-- | config/environments/production.rb | 17 |
3 files changed, 35 insertions, 1 deletions
diff --git a/config/application.rb b/config/application.rb index 92fd30685..5ce58b588 100644 --- a/config/application.rb +++ b/config/application.rb @@ -6,7 +6,7 @@ require File.dirname(__FILE__) + '/../lib/configuration' # If you have a Gemfile, require the gems listed there, including any gems # you've limited to :test, :development, or :production. -Bundler.require(:default, Rails.env) if defined?(Bundler) +Bundler.require(:default, :assets, Rails.env) if defined?(Bundler) module Alaveteli class Application < Rails::Application @@ -71,5 +71,15 @@ module Alaveteli # Insert a bit of middleware code to prevent uneeded cookie setting. require "#{Rails.root}/lib/whatdotheyknow/strip_empty_sessions" config.middleware.insert_before ActionDispatch::Session::CookieStore, WhatDoTheyKnow::StripEmptySessions, :key => '_wdtk_cookie_session', :path => "/", :httponly => true + + # 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' + + # Change the path that assets are served from + # config.assets.prefix = "/assets" + end end diff --git a/config/environments/development.rb b/config/environments/development.rb index 54ab2977f..629685c50 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -27,4 +27,11 @@ Alaveteli::Application.configure do # Print deprecation notices to the Rails logger config.active_support.deprecation = :log + + # Do not compress assets + config.assets.compress = false + + # Expands the lines which load the assets + config.assets.debug = true + end diff --git a/config/environments/production.rb b/config/environments/production.rb index 0c1929366..a3e3cebd2 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -31,4 +31,21 @@ Alaveteli::Application.configure do if AlaveteliConfiguration::force_ssl config.middleware.insert_before ActionDispatch::Cookies, ::Rack::SSL end + + # Compress JavaScripts and CSS + config.assets.compress = true + + # Choose the compressors to use + # config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :yui + + # 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 + + # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) + # config.assets.precompile += %w( search.js ) + end |