Module: PagesCore::Admin::ImageUploadsHelper

Included in:
AdminHelper
Defined in:
app/helpers/pages_core/admin/image_uploads_helper.rb

Instance Method Summary collapse

Instance Method Details

#editable_dynamic_image_tag(image, width: 250, caption: false, locale: nil) ⇒ Object

Generates tags for an editable dynamic image.



7
8
9
10
11
12
13
14
15
16
# File 'app/helpers/pages_core/admin/image_uploads_helper.rb', line 7

def editable_dynamic_image_tag(image, width: 250,
                               caption: false, locale: nil)
  react_component("EditableImage",
                  editable_image_options(
                    image,
                    width:,
                    caption:,
                    locale:
                  ).merge(width:))
end

#image_uploader_tag(name, image, options = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'app/helpers/pages_core/admin/image_uploads_helper.rb', line 18

def image_uploader_tag(name, image, options = {})
  opts = { caption: false, locale: nil }.merge(options)
  react_component("ImageUploader",
                  editable_image_options(
                    image,
                    caption: opts[:caption],
                    locale: opts[:locale]
                  ).merge(attr: name, alternative: opts[:alternative]))
end