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

18 lines
452 B

6 years ago
module LibrariesHelper
5 years ago
def show_library_tags(library, opts = {})
6 years ago
html = ''
library.library_tags.each do |tag|
5 years ago
klass = "edu-filter-btn fl cdefault #{library_tag_class(tag)} #{opts[:class]}"
html += content_tag(:span, tag.name, class: klass)
6 years ago
end
raw html
end
def library_tag_class(tag)
case tag.name
when '获奖案例' then 'edu-activity-red'
6 years ago
when '入库案例' then 'edu-activity-blue'
end
end
end