fix neuigkeit

This commit is contained in:
Andreas Stephanides
2013-08-23 16:07:13 +02:00
parent ee7f06cb23
commit 2548ddb9ab
5 changed files with 21 additions and 11 deletions

View File

@@ -36,4 +36,8 @@ class Neuigkeit < ActiveRecord::Base
def reverse_publish
self.datum = nil
end
def text_first_words
md = /<p>(?<text>[\w\s,\.!\?]*)/.match self.text
md[:text].split(" ")[1..100].join(" ")+ " ..."
end
end