Module: Ires::ViewHelper

Defined in:
lib/ires/view_helper.rb

Instance Method Summary collapse

Instance Method Details

#ires_tag(path:, width:, height:, type: Type::ALL, mode: Mode::RESIZE, expire: 30.days, **option) ⇒ image_tag

Image resize

Returns:

  • (image_tag)


11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ires/view_helper.rb', line 11

def ires_tag(path:, width:, height:, type: Type::ALL, mode: Mode::RESIZE, expire: 30.days, **option)
  image = Ires::Service.path(
    path: path,
    width: width,
    height: height,
    mode: mode,
    type: type,
    expire: expire
  )
  return nil if image.nil?

  # Set image_tag
  image_tag(image, option)
end