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

module LibrariesHelper
def show_library_tags(library, opts = {})
html = ''
library.library_tags.each do |tag|
klass = "edu-filter-btn fl cdefault #{library_tag_class(tag)} #{opts[:class]}"
html += content_tag(:span, tag.name, class: klass)
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