Module: TagHelper
- Defined in:
- lib/helper/tag_helper.rb
Constant Summary collapse
- KINDS =
/音乐|戏剧|讲座|聚会|电影|展览|运动|公益|旅行|派对/
Instance Method Summary collapse
Instance Method Details
#deal_kind(str) ⇒ Object
5 6 7 8 9 |
# File 'lib/helper/tag_helper.rb', line 5 def deal_kind(str) kinds = str.scan(KINDS).first.to_s kinds = '其他' if kinds.blank? kinds end |
#deal_subkind(str) ⇒ Object
11 12 13 14 15 |
# File 'lib/helper/tag_helper.rb', line 11 def deal_subkind(str) if str.include?("-") sub_kinds = str.slice((/-/ =~ str).to_i + 1,str.length) end end |