Check for 0 themen

This commit is contained in:
Thomas Blazek
2015-01-11 22:18:31 +01:00
parent 79ba089b70
commit 85d2bb5bf9

View File

@@ -2,8 +2,12 @@ class HomeController < ApplicationController
def index
@beispiele = Beispiel.last([Beispiel.count, 3].min)
@neuigkeiten = Neuigkeit.recent
if Thema.count>0
t=YAML.load_file("#{::Rails.root.to_s}/config/start_topic.yml")
@starttopic= @themen = Thema.where(:id=>t).first
else
@starttopic=@themen = nil
end
end
def dev