From 85d2bb5bf9ddb4e568d4886fb11be5f87c0966df Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Sun, 11 Jan 2015 22:18:31 +0100 Subject: [PATCH] Check for 0 themen --- app/controllers/home_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 34725b2..c85071d 100755 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -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