Module: Ires::ViewHelper

Defined in:
lib/ires/view_helper.rb

Instance Method Summary collapse

Instance Method Details

#ires_tag(path, width: nil, height: nil, 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
# File 'lib/ires/view_helper.rb', line 11

def ires_tag(path, width: nil, height: nil, type: Type::ALL, mode: Mode::RESIZE, expire: 30.days, **option)
  image_path = Ires::Service.path(
    path,
    width: width || 0,
    height: height || 0,
    mode: mode,
    type: type,
    expire: expire
  )

  # Set image_tag
  image_tag(image_path, option)
end