forked from bofh/fetsite
neuigkeiten fix
This commit is contained in:
@@ -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])
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user