Module: C80Yax::Cats::CatListsHelper

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

Instance Method Summary collapse

Instance Method Details

#render_cats_iconed_list(n = 4, &make_url) ⇒ Object



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

def render_cats_iconed_list(n = 4, &make_url)
  proc_make_url = proc &make_url
  cats = Cat.iconed_list(n)
  render :partial => 'c80_yax/cats/cats_iconed_list',
         :locals => {
             cats: cats,
             proc_make_url: proc_make_url
         }
end

#render_cats_strsubcats(&make_strsubcat_url) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/helpers/c80_yax/cats/cat_lists_helper.rb', line 15

def render_cats_strsubcats(&make_strsubcat_url)

  rdo = Cat.includes(:strsubcats)
  res = ''

  rdo.each do |category|
    r = "<h2 class='title'>#{category.title}</h2>"
    ds = ul_strsubcats(category, &make_strsubcat_url)
    next if ds.blank? # (**)
    r += ds
    res += "<li class='li_category' id='category_#{category.id}'>#{r}</li>"
  end

  "<ul class='ul_cats_strsubcats'>#{res}</ul>".html_safe

end