Module: PhrasingPlusHelper

Defined in:
app/helpers/phrasing_plus_helper.rb

Instance Method Summary collapse

Instance Method Details

#phrasing_background_image_tag(key, options = {}, &block) ⇒ Object



8
9
10
11
12
13
# File 'app/helpers/phrasing_plus_helper.rb', line 8

def phrasing_background_image_tag(key, options = {}, &block)
  image = PhrasingImage.find_or_create_by(key: key)
  wrapped_html = capture(&block) if block_given?
  image_widget = PhrasingBackgroundImageWidget.new(image, self, wrapped_html, options)
  render 'phrasing_plus/editable_background_image', widget: image_widget
end

#phrasing_image_tag(key, options = {}) ⇒ Object



2
3
4
5
6
# File 'app/helpers/phrasing_plus_helper.rb', line 2

def phrasing_image_tag(key, options = {})
  image = PhrasingImage.find_or_create_by(key: key)
  image_widget = PhrasingImageWidget.new(image, self, options)
  render 'phrasing_plus/editable_image', widget: image_widget
end