forked from bofh/fetsite
neuigkeiten fix
This commit is contained in:
@@ -1,10 +1,6 @@
|
|||||||
class NeuigkeitenController < ApplicationController
|
class NeuigkeitenController < ApplicationController
|
||||||
before_filter {@toolbar_elements=[]}
|
before_filter {@toolbar_elements=[]}
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
#def index
|
|
||||||
# @neuigkeiten = Neuigkeit.all
|
|
||||||
#end
|
|
||||||
|
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@neuigkeit = Neuigkeit.find(params[:id])
|
@neuigkeit = Neuigkeit.find(params[:id])
|
||||||
|
|||||||
@@ -40,6 +40,6 @@ class Neuigkeit < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
def text_first_words
|
def text_first_words
|
||||||
md = /<p>(?<text>[\w\s,\.!\?]*)/.match self.text
|
md = /<p>(?<text>[\w\s,\.!\?]*)/.match self.text
|
||||||
md[:text].split(" ")[1..100].join(" ")+ " ..."
|
md[:text].split(" ")[0..100].join(" ")+ " ..."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user