diff options
Diffstat (limited to 'guides/source/asset_pipeline.textile')
-rw-r--r-- | guides/source/asset_pipeline.textile | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/guides/source/asset_pipeline.textile b/guides/source/asset_pipeline.textile index 6df23e55dd..d0952fcf29 100644 --- a/guides/source/asset_pipeline.textile +++ b/guides/source/asset_pipeline.textile @@ -651,25 +651,18 @@ WARNING: If you are upgrading an existing application and intend to use this opt h3. Assets Cache Store -If you will not configure assets cache store, your application's cache store will be used to cache assets in development and production. - -You always can access your application's cache by calling +Rails.cache+. - -Default assets cache store can be changed to something else, like memory store: +Sprockets uses the default Rails cache store will be used to cache assets in development and production. This can be changed by setting +config.assets.cache_store+. <ruby> config.assets.cache_store = :memory_store </ruby> -All the assets cache store parameters should be passed in the same way like for application's cache store. +The options accepted by the assets cache store are the same as the application's cache store. <ruby> config.assets.cache_store = :memory_store, { :size => 32.megabytes } </ruby> -Any appropriate application cache store adapter can be used for assets cache store. -You can read more about application's cache stores and their options in the "Caching with Rails Guide":./caching_with_rails.html#cache-stores. - h3. Adding Assets to Your Gems Assets can also come from external sources in the form of gems. @@ -682,11 +675,9 @@ TODO: Registering gems on "Tilt":https://github.com/rtomayko/tilt enabling Sproc h3. Upgrading from Old Versions of Rails -There are three issues when upgrading. The first is moving the files from +public/+ to the new locations. See "Asset Organization":#asset-organization above for guidance on the correct locations for different file types. +There are a few issues when upgrading. The first is moving the files from +public/+ to the new locations. See "Asset Organization":#asset-organization above for guidance on the correct locations for different file types. -The second is avoiding duplicate javascript files. If you use jquery or jquery_ujs in your manifest file, there are two changes you must make. -# You must be careful not to copy over your old javascript files which are included in the manifest file, or they will conflict. -# You must remove references to these in your layout files (since application.js will include them now). +Next will be avoiding duplicate JavaScript files. Since jQuery is the default JavaScript library from Rails 3.1 onwards, you don't need to copy +jquery.js+ into +app/assets+ and it will be included automatically. The third is updating the various environment files with the correct default options. The following changes reflect the defaults in version 3.1.0. @@ -744,8 +735,8 @@ The following should also be added to +Gemfile+: # 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" + gem 'sass-rails', "~> 3.2.3" + gem 'coffee-rails', "~> 3.2.1" gem 'uglifier' end </plain> @@ -768,5 +759,3 @@ Instead of the old Rails 3.0 version: # you've limited to :test, :development, or :production. Bundler.require(:default, Rails.env) if defined?(Bundler) </ruby> - - |