ruby on rails helper category

    14.19 Muhamad Akbar Bin Widayat 0 Comments


    def category
               str = "<ul>"
          Category.parent_categories.each do |parent|
    str +=  "<li>#{link_to parent.name, category_path(parent.id)}<li>"
            parent.child_categories.each do |child|
           str += "<ul><li>#{child.name}</li></ul>"
                    end
    end
    str += "</ul>"  
    return str
             end

    0 komentar:

    terimakasih komentarnya