Module: Card::Set::Type::Image::EmailHtmlFormat

Extended by:
AbstractFormat
Defined in:
platypus/tmp/set/gem-defaults/mod016-carrierwave/type/image.rb

Instance Method Summary collapse

Instance Method Details

#attach_image(mail, path) ⇒ Object



100
101
102
103
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/image.rb', line 100

def attach_image mail, path
  mail.attachments.inline[path] = ::File.read path
  mail.attachments[path].url
end

#view: inlineObject



90
91
92
93
94
95
96
97
98
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/image.rb', line 90

view :inline, cache: :never do
  handle_source do |source|
    return source unless (mail = inherit :active_mail) &&
                         ::File.exist?(path = selected_version.path)

    url = attach_image mail, path
    image_tag url
  end
end