module LibrariesHelper def show_library_tags(library) html = '' library.library_tags.each do |tag| html += content_tag(:span, tag.name, class: "edu-filter-btn fl cdefault mt3 ml10 " + library_tag_class(tag)) end raw html end def library_tag_class(tag) case tag.name when '优秀案例' then 'edu-activity-red' when '入库案例' then 'edu-activity-blue' end end end