Kleinigkeiten, formatierung, bugfix

This commit is contained in:
Thomas Blazek
2013-07-25 16:59:28 +02:00
parent 0e4574603d
commit 0620185a8b
3 changed files with 22 additions and 21 deletions

View File

@@ -9,7 +9,7 @@ class LvasController < ApplicationController
# GET /lvas/1
def show
@lva = Lva.find(params[:id])
@lva = Lva.find_by_id(params[:id])
@toolbar_elements<<{:icon=>:pencil,:text =>I18n.t('common.edit'),:path => edit_lva_path(@lva)}
end

View File

@@ -3,14 +3,15 @@ class ModulsController < ApplicationController
# GET /moduls.json
def index
@moduls = Modul.all
if !params[:studium_id].nil?
@studium=Studium.find(params[:studium_id])
end
respond_to do |format|
format.html # index.html.erb
format.json { render json: @moduls }
if @moduls
if !params[:studium_id].nil?
@studium=Studium.find_by_id(params[:studium_id])
end
respond_to do |format|
format.html # index.html.erb
format.json { render json: @moduls }
end
end
end
# GET /moduls/1

View File

@@ -40,19 +40,19 @@ private
##
# Lade Daten aus TISS und füge diese in die Datenbank ein.
def load_tissdata
url= "https://tiss.tuwien.ac.at/api/course/"+ self.lvanr.to_s+"-2012W"
begin
@hash=Hash.from_xml(open(url).read)["tuvienna"]
@person=[]
if @hash["course"]["lecturers"]["oid"].is_a? String
@person = @hash["course"]["lecturers"]["oid"]
else
@hash["course"]["lecturers"]["oid"].each do |pid|
@person << Hash.from_xml(open("https://tiss.tuwien.ac.at/adressbuch/adressbuch/person_via_oid/" + pid.to_s + ".xml").read)["tuvienna"]["person"]
end
end
rescue OpenURI::HTTPError => e
end
url= "https://tiss.tuwien.ac.at/api/course/"+ self.lvanr.to_s+"-2012W"
begin
@hash=Hash.from_xml(open(url).read)["tuvienna"]
@person=[]
if @hash["course"]["lecturers"]["oid"].is_a? String
@person = @hash["course"]["lecturers"]["oid"]
else
@hash["course"]["lecturers"]["oid"].each do |pid|
@person << Hash.from_xml(open("https://tiss.tuwien.ac.at/adressbuch/adressbuch/person_via_oid/" + pid.to_s + ".xml").read)["tuvienna"]["person"]
end
end
rescue OpenURI::HTTPError => e
end
end