Module CategoriesHelper
In: app/helpers/categories_helper.rb

Methods

Public Instance methods

[Source]

    # File app/helpers/categories_helper.rb, line 16
16:   def link_to_category(category)
17:     if match = category.name.match(/\"(.+)\":(.+$)/)
18:       link_to h(match[1]), match[2]
19:     else
20:       link_to h(category.name), category
21:     end
22:   end

[Source]

    # File app/helpers/categories_helper.rb, line 2
 2:   def menu_item_class(category, current_category, mark_ancestors=true)
 3:     output = "passive"
 4:     if current_category 
 5:       ancestor_ids = current_category.ancestors.collect(&:id)
 6:       if category.id == current_category.id 
 7:         return "active"
 8:       end
 9:       if mark_ancestors && ancestor_ids.include?(category.id) 
10:         return "active"
11:       end
12:     end
13:     return output
14:   end

[Source]

    # File app/helpers/categories_helper.rb, line 24
24:   def url_for_category(category)
25:     if match = category.name.match(/\"(.+)\":(.+$)/)
26:       if match[2].match("http://")
27:         match[2]
28:       else
29:         "http://" + request.host_with_port + match[2]
30:       end
31:     else
32:       category_url(category)
33:     end
34:   end

[Validate]