neuigkeiten fix

This commit is contained in:
Andreas Stephanides
2013-09-01 14:50:10 +02:00
parent 9b16843d83
commit 15aa7ec58b
2 changed files with 1 additions and 5 deletions

View File

@@ -1,10 +1,6 @@
class NeuigkeitenController < ApplicationController
before_filter {@toolbar_elements=[]}
load_and_authorize_resource
#def index
# @neuigkeiten = Neuigkeit.all
#end
def show
@neuigkeit = Neuigkeit.find(params[:id])

View File

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