ruby on rails helper category
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
Komentar
Posting Komentar
terimakasih komentarnya