Module: SeriousBlogHelper

Defined in:
lib/serious_blog_helper.rb

Class Method Summary collapse

Class Method Details

.tags_from_article(article = nil) ⇒ Object

extract tags from article



5
6
7
8
9
10
11
12
# File 'lib/serious_blog_helper.rb', line 5

def SeriousBlogHelper.tags_from_article(article=nil)
  tags_marker = %&tags"=>&
  if article && article.inspect.index(tags_marker)
    tags_start_index=article.inspect.index(tags_marker) + tags_marker.length
    tags_end_index = article.inspect.index("\"," ,tags_start_index)
    tags = article.inspect[tags_start_index+1..tags_end_index-1]
  end
end