Controller Update
This commit is contained in:
@@ -68,7 +68,7 @@ class ModulsController < ApplicationController
|
|||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @modul.update_attributes(params[:modul])
|
if @modul.update_attributes(params[:modul])
|
||||||
format.html { redirect_to modul_path(@modul), notice: 'Modul was successfully updated.' }
|
format.html { redirect_to url_for(@modul), notice: 'Modul was successfully updated.' }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
format.html { render action: "edit" }
|
format.html { render action: "edit" }
|
||||||
|
|||||||
@@ -18,11 +18,14 @@ class StudienController < ApplicationController
|
|||||||
opts={:width=>4, :slice=>3}
|
opts={:width=>4, :slice=>3}
|
||||||
end
|
end
|
||||||
modulgruppen =[]
|
modulgruppen =[]
|
||||||
modulgruppen_phase.each_slice(opts[:slice]) do |s| modulgruppen<<s end
|
modulgruppen_phase.each_slice(opts[:slice]) do |s|
|
||||||
|
modulgruppen<<s
|
||||||
|
end
|
||||||
@studienphasen << {:modulgruppen=>modulgruppen, :phase => ph}.merge(opts)
|
@studienphasen << {:modulgruppen=>modulgruppen, :phase => ph}.merge(opts)
|
||||||
@toolbar_elements=[{:text => '<i class="icon-plus"></i> '.html_safe + I18n.t('studien.new') , :path => new_modul_path() }]
|
|
||||||
|
@toolbar_elements=[{:text => '<i class="icon-plus"></i> '.html_safe + I18n.t('studien.new') , :path => new_studium_modulgruppe_path(@studium) }]
|
||||||
@toolbar_elements<<{:text => '<i class="icon-pencil"></i> '.html_safe + I18n.t('common.edit'),:path=>edit_studium_path(@studium)}
|
@toolbar_elements<<{:text => '<i class="icon-pencil"></i> '.html_safe + I18n.t('common.edit'),:path=>edit_studium_path(@studium)}
|
||||||
#@toolbar_elements<<{:text ='<i class="icon-cross"></i> '.html_safe +I18n.t('common.delete'),path => delete_studium_path(@studium)}
|
@toolbar_elements<<{:link=> link_to('Destroy', @studium, method: :delete, data: { confirm: 'Are you sure?' })}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -33,6 +36,8 @@ class StudienController < ApplicationController
|
|||||||
# GET /studia/1/edit
|
# GET /studia/1/edit
|
||||||
def edit
|
def edit
|
||||||
@studium = Studium.find(params[:id])
|
@studium = Studium.find(params[:id])
|
||||||
|
@toolbar_elements=[{:text => I18n.t('studien.anzeigen') , :path => url_for(@studium) }]
|
||||||
|
@toolbar_elements<<{:text =>I18n.t('studien.allestudien'),:path=>studien_path(@studium)}
|
||||||
end
|
end
|
||||||
|
|
||||||
# POST /studia
|
# POST /studia
|
||||||
@@ -42,11 +47,9 @@ class StudienController < ApplicationController
|
|||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @studium.save
|
if @studium.save
|
||||||
format.html { redirect_to @studium, notice: 'Studium was successfully created.' }
|
format.html { redirect_to url_for(@studium), notice: 'Studium was successfully created.' }
|
||||||
format.json { render json: @studium, status: :created, location: @studium }
|
|
||||||
else
|
else
|
||||||
format.html { render action: "new" }
|
format.html { render action: "new" }
|
||||||
format.json { render json: @studium.errors, status: :unprocessable_entity }
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -57,7 +60,7 @@ class StudienController < ApplicationController
|
|||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @studium.update_attributes(params[:studium])
|
if @studium.update_attributes(params[:studium])
|
||||||
format.html { redirect_to @studium, notice: 'Studium was successfully updated.' }
|
format.html { redirect_to url_for(@studium), notice: 'Studium was successfully updated.' }
|
||||||
|
|
||||||
else
|
else
|
||||||
format.html { render action: "edit" }
|
format.html { render action: "edit" }
|
||||||
@@ -71,6 +74,6 @@ class StudienController < ApplicationController
|
|||||||
def destroy
|
def destroy
|
||||||
@studium = Studium.find(params[:id])
|
@studium = Studium.find(params[:id])
|
||||||
@studium.destroy
|
@studium.destroy
|
||||||
redirect_to studien_url
|
redirect_to studien_url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ de:
|
|||||||
actions: "Aktionen"
|
actions: "Aktionen"
|
||||||
studien:
|
studien:
|
||||||
list: "Studien der Fakultät Elektrotechnik"
|
list: "Studien der Fakultät Elektrotechnik"
|
||||||
|
anzeigen: "Studium anzeigen"
|
||||||
new: "Neues Studium"
|
new: "Neues Studium"
|
||||||
newmodulgroup: "Neue Modulgruppe"
|
newmodulgroup: "Neue Modulgruppe"
|
||||||
allestudien: "Alle Studien"
|
allestudien: "Alle Studien"
|
||||||
|
|||||||
Reference in New Issue
Block a user