From 5aedfa752e40c7758c18a48837d113d9a643033f Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Tue, 1 Apr 2014 10:25:44 +0200 Subject: [PATCH] Fixed Bug when loading from tiss + typo in lvas_controller The Bug would ALWAYS appear if Pruefungsinformation is empty at submission. The Fix replaces the empty string with an dummy div-block. This maybe has to be checked for all input fields. --- app/controllers/lvas_controller.rb | 3 +-- app/controllers/moduls_controller.rb | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/lvas_controller.rb b/app/controllers/lvas_controller.rb index 2c96802..b7db436 100755 --- a/app/controllers/lvas_controller.rb +++ b/app/controllers/lvas_controller.rb @@ -52,7 +52,7 @@ class LvasController < ApplicationController @lva = Lva.find_by_id(params[:lva_id]) @lva.load_tissdata("-2013W") if @lva.save - redirect_to @lva , notice: 'Lva von TISS geleaden.' + redirect_to @lva , notice: 'Lva von TISS geladen.' else redirect_to @lva, action: :compare_tiss end @@ -64,7 +64,6 @@ class LvasController < ApplicationController # POST /lvas.json def create @lva = Lva.new(params[:lva]) - respond_to do |format| if @lva.save @lva.add_semesters diff --git a/app/controllers/moduls_controller.rb b/app/controllers/moduls_controller.rb index ace786b..2d42f20 100755 --- a/app/controllers/moduls_controller.rb +++ b/app/controllers/moduls_controller.rb @@ -91,11 +91,12 @@ class ModulsController < ApplicationController lva.desc=l["desc"] lva.semester=Semester.where(:id=>l["semester_ids"].map(&:to_i)) lva.stunden=l["stunden"] - lva.pruefungsinformation=l["pruefungsinformation"] + pr =l["pruefungsinformation"] + lva.pruefungsinformation= (pr.empty?) ? "
" : pr lva.lernaufwand=l["lernaufwand"] lva.typ=l["typ"] lva.save - @newlvas<