forked from bofh/fetsite
Controller Update
This commit is contained in:
@@ -68,7 +68,7 @@ class ModulsController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
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 }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
|
||||
@@ -18,11 +18,14 @@ class StudienController < ApplicationController
|
||||
opts={:width=>4, :slice=>3}
|
||||
end
|
||||
modulgruppen =[]
|
||||
modulgruppen_phase.each_slice(opts[:slice]) do |s| modulgruppen<<s end
|
||||
@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-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)}
|
||||
modulgruppen_phase.each_slice(opts[:slice]) do |s|
|
||||
modulgruppen<<s
|
||||
end
|
||||
@studienphasen << {:modulgruppen=>modulgruppen, :phase => ph}.merge(opts)
|
||||
|
||||
@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<<{:link=> link_to('Destroy', @studium, method: :delete, data: { confirm: 'Are you sure?' })}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -33,6 +36,8 @@ class StudienController < ApplicationController
|
||||
# GET /studia/1/edit
|
||||
def edit
|
||||
@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
|
||||
|
||||
# POST /studia
|
||||
@@ -42,11 +47,9 @@ class StudienController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
if @studium.save
|
||||
format.html { redirect_to @studium, notice: 'Studium was successfully created.' }
|
||||
format.json { render json: @studium, status: :created, location: @studium }
|
||||
format.html { redirect_to url_for(@studium), notice: 'Studium was successfully created.' }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.json { render json: @studium.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -57,7 +60,7 @@ class StudienController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
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
|
||||
format.html { render action: "edit" }
|
||||
@@ -69,8 +72,8 @@ class StudienController < ApplicationController
|
||||
# DELETE /studia/1
|
||||
# DELETE /studia/1.json
|
||||
def destroy
|
||||
@studium = Studium.find(params[:id])
|
||||
@studium.destroy
|
||||
redirect_to studien_url
|
||||
@studium = Studium.find(params[:id])
|
||||
@studium.destroy
|
||||
redirect_to studien_url
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,6 +7,7 @@ de:
|
||||
actions: "Aktionen"
|
||||
studien:
|
||||
list: "Studien der Fakultät Elektrotechnik"
|
||||
anzeigen: "Studium anzeigen"
|
||||
new: "Neues Studium"
|
||||
newmodulgroup: "Neue Modulgruppe"
|
||||
allestudien: "Alle Studien"
|
||||
|
||||
Reference in New Issue
Block a user