Module: Cms::Attachments

Defined in:
lib/cms/attachments/configuration.rb,
lib/cms/attachments/attachment_serving.rb

Overview

Cms::Attachments::Configuration exposes an interface to setup paperclip for BrowserCMS.

Provides defaults that are suitable for the CMS and that probably make sense for most installations.

This module also declares Paperclip interpolations that are used to construct the default url and path.

For example, the default path:

“:attachments_root/:id_partition/:style/:fingerprint”

expands to something like:

#{Rails.root}/tmp/uploads/2011/1/30/thumb/thcu098rc87dgd

but can be changed by using paperclip interpolations, either the ones already defined by Paperlip itself, the Cms::Assets module, or user defined.

Defined Under Namespace

Modules: Serving Classes: Configuration, FilesystemStrategy

Class Method Summary collapse

Class Method Details

.configurationObject


33
34
35
# File 'lib/cms/attachments/configuration.rb', line 33

def self.configuration
  @@configuration || Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:


26
27
28
29
30
31
# File 'lib/cms/attachments/configuration.rb', line 26

def self.configure
  configuration = self.configuration
  yield configuration if block_given?
  @@configuration = configuration
  Attachment.configure_paperclip
end