forked from bofh/fetsite
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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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?) ? "<div></div>" : pr
|
||||
lva.lernaufwand=l["lernaufwand"]
|
||||
lva.typ=l["typ"]
|
||||
lva.save
|
||||
@newlvas<<lva
|
||||
@newlvas<<lva #
|
||||
end
|
||||
@lvas=@newlvas
|
||||
if @newlvas.map(&:valid?).all?
|
||||
@@ -121,7 +122,7 @@ class ModulsController < ApplicationController
|
||||
lva.lvanr=l["lvanr"]
|
||||
lva.load_tissdata("-"+ l["sem"])
|
||||
lva.modul<<@modul
|
||||
@lvas<<lva
|
||||
@lvas<<lva #
|
||||
end
|
||||
end
|
||||
render 'edit_lvas'
|
||||
|
||||
Reference in New Issue
Block a user