Module: OmgImage::ApplicationHelper
- Includes:
- OmgHelper
- Defined in:
- app/helpers/omg_image/application_helper.rb
Constant Summary
Constants included from OmgHelper
Instance Method Summary collapse
Methods included from OmgHelper
Instance Method Details
#omg_image_preview(template, options) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/helpers/omg_image/application_helper.rb', line 10 def omg_image_preview(template, ) ||= {} [:size] ||= '800,400' [:key] ||= .to_s image = OmgImage::Image.find_by(key: [:key]) if image && !image.file.attached? image.destroy image = nil end file = image&.file || create_screenshot(template, ) url_for(file) if file end |