You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pgfqe6ch8/app/helpers/libraries_helper.rb

17 lines
414 B

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