forked from bofh/fetsite
fix neuigkeiten model
This commit is contained in:
@@ -66,7 +66,7 @@ class ModulsController < ApplicationController
|
|||||||
def edit_lvas
|
def edit_lvas
|
||||||
@modul = Modul.find(params[:modul_id])
|
@modul = Modul.find(params[:modul_id])
|
||||||
@lvas = @modul.lvas
|
@lvas = @modul.lvas
|
||||||
@semester = @modul.modulgruppen.flatten.map(&:studium).map(&:semester).flatten.uniq
|
@semester = @modul.modulgruppen.flatten.map(&:studium).map(&:semester).flatten.uniq
|
||||||
|
|
||||||
end
|
end
|
||||||
def update_lvas
|
def update_lvas
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class Neuigkeit < ActiveRecord::Base
|
|||||||
self.title
|
self.title
|
||||||
end
|
end
|
||||||
def text_first_words
|
def text_first_words
|
||||||
md = /<p>(?<text>[\w\s,\.!\?]*)/.match strip_links(self.text)
|
md = /<p>(?<text>[\w\s,\.!\?]*)/.match self.text
|
||||||
words=md[:text].split(" ") unless md.nil?
|
words=md[:text].split(" ") unless md.nil?
|
||||||
if words.nil? || words.empty?
|
if words.nil? || words.empty?
|
||||||
"...."
|
"...."
|
||||||
|
|||||||
Reference in New Issue
Block a user