Module: Sinicum::MgnlImageHelper

Includes:
HelperUtils
Included in:
MgnlHelper5
Defined in:
app/helpers/sinicum/mgnl_image_helper.rb

Constant Summary

Constants included from HelperUtils

HelperUtils::DEFAULT_DOCUMENT_WORKSPACE, HelperUtils::FINGERPRINT_REGEX

Instance Method Summary collapse

Instance Method Details

#mgnl_asset_path(key_or_object = nil, options = {}) ⇒ Object



6
7
8
9
# File 'app/helpers/sinicum/mgnl_image_helper.rb', line 6

def mgnl_asset_path(key_or_object = nil, options = {})
  options[:workspace] = "dam"
  mgnl_path(key_or_object, options)
end

#mgnl_img(key_or_object, options = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/helpers/sinicum/mgnl_image_helper.rb', line 11

def mgnl_img(key_or_object, options = {})
  image = object_from_key_or_object(key_or_object, workspace(options))
  result = nil
  if image
    options = options.dup
    attributes = image_attributes(image, options)
    [:workspace, :renderer, :width, :height, :src, :alt].each do |attribute|
      options.delete(attribute)
    end
    add_missing_attributes(attributes, options)
    result = tag("img", attributes)
  end
  result
end