Module: Pageflow::BackgroundImageHelper

Defined in:
app/helpers/pageflow/background_image_helper.rb

Defined Under Namespace

Classes: Div, DivWithSizeAttributes

Instance Method Summary collapse

Instance Method Details

#background_image_div(configuration, property_base_name, options = {}) ⇒ Object


3
4
5
# File 'app/helpers/pageflow/background_image_helper.rb', line 3

def background_image_div(configuration, property_base_name, options = {})
  Div.new(self, configuration, property_base_name, options).render
end

#background_image_div_with_size(configuration, property_base_name, options = {}) ⇒ Object


7
8
9
# File 'app/helpers/pageflow/background_image_helper.rb', line 7

def background_image_div_with_size(configuration, property_base_name, options = {})
  DivWithSizeAttributes.new(self, configuration, property_base_name, options).render
end

#background_image_tag(image_id, options = {}) ⇒ Object


11
12
13
14
15
16
17
# File 'app/helpers/pageflow/background_image_helper.rb', line 11

def background_image_tag(image_id, options = {})
  if image = ImageFile.find_by_id(image_id)
    options = options.merge(:'data-src' => image.attachment.url(:medium))
    options = options.merge(:'data-printsrc' => image.attachment.url(:print))
    image_tag('', options)
  end
end