Module: C80Yax::Cats::CatViewHelper

Defined in:
app/helpers/c80_yax/cats/cat_view_helper.rb

Instance Method Summary collapse

Instance Method Details

#cat_image_tag(cat, thumb_type = 'thumb_md') ⇒ Object

выдать html строку с image_tag картинки категории



6
7
8
9
10
11
12
# File 'app/helpers/c80_yax/cats/cat_view_helper.rb', line 6

def cat_image_tag(cat, thumb_type = 'thumb_md')
  res = ''
  if cat.image.present?
    res = image_tag cat.image.thumb_md
  end
  res.html_safe
end

#cat_image_url(cat, thumb_type = 'thumb_md') ⇒ Object

выдать урл картинки категории



15
16
17
18
19
20
21
# File 'app/helpers/c80_yax/cats/cat_view_helper.rb', line 15

def cat_image_url(cat, thumb_type = 'thumb_md')
  res = ''
  if cat.image.present?
    res = cat.image.send(thumb_type)
  end
  res
end