Permalink
Browse files

Merge branch 'hotfix/assets'

* hotfix/assets:
  Update assets related configuration
  • Loading branch information...
2 parents d952f61 + 73ac46b commit b1dfee1bf7b914441c7a12fff15ca9d710ed6828 Timur Vafin committed Jan 10, 2012
View
@@ -9,6 +9,8 @@ group :assets do
gem 'sass-rails', '~> 3.1.5'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
+ gem 'flutie'
+ gem 'bourbon'
end
gem 'jquery-rails'
@@ -21,8 +23,6 @@ gem 'simple-navigation'
gem 'simple_form'
gem 'client_side_validations'
gem 'tabletastic'
-gem 'flutie'
-gem 'bourbon'
gem 'inherited_resources'
gem 'kaminari'
View
@@ -2,9 +2,12 @@
require 'rails/all'
-# 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)
+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 Rails3Base
class Application < Rails::Application
@@ -38,5 +41,8 @@ class Application < Rails::Application
# 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'
end
end
@@ -24,4 +24,7 @@
# Do not compress assets
config.assets.compress = false
+
+ # Expands the lines which load the assets
+ config.assets.debug = true
end
@@ -14,12 +14,18 @@
# Compress JavaScripts and CSS
config.assets.compress = true
- # Specify the default JavaScript compressor
- config.assets.js_compressor = :uglifier
+ # 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
+
+ # Defaults to Rails.root.join("public/assets")
+ # config.assets.manifest = YOUR_PATH
# Specifies the header that your server uses for sending files
- # (comment out if your front-end server doesn't support this)
- config.action_dispatch.x_sendfile_header = "X-Sendfile" # Use 'X-Accel-Redirect' for nginx
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
@@ -4,9 +4,11 @@
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
-ActionController::Base.wrap_parameters :format => [:json]
+ActiveSupport.on_load(:action_controller) do
+ wrap_parameters :format => [:json]
+end
# Disable root element in JSON by default.
-if defined?(ActiveRecord)
- ActiveRecord::Base.include_root_in_json = false
+ActiveSupport.on_load(:active_record) do
+ self.include_root_in_json = false
end

0 comments on commit b1dfee1

Please sign in to comment.