forked from bofh/fetsite
Change in handling
This commit is contained in:
@@ -5,10 +5,11 @@ class ModulgruppenController < ApplicationController
|
|||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
def index
|
def index
|
||||||
@modulgruppen = Modulgruppe.all
|
@modulgruppen = Modulgruppe.all
|
||||||
if !params[:studium_id].nil?
|
if !params[:studium_id].nil?
|
||||||
@studium=Studium.find(params[:studium_id])
|
@studium=Studium.find(params[:studium_id])
|
||||||
|
else
|
||||||
|
@studium=Studium.first
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /modulgruppen/1
|
# GET /modulgruppen/1
|
||||||
@@ -25,9 +26,15 @@ class ModulgruppenController < ApplicationController
|
|||||||
|
|
||||||
def new
|
def new
|
||||||
@modulgruppe = Modulgruppe.new
|
@modulgruppe = Modulgruppe.new
|
||||||
if !params[:studium_id].nil?
|
if !params[:studium_id].nil?
|
||||||
@studium=Studium.find(params[:studium_id])
|
@studium=Studium.find(params[:studium_id])
|
||||||
|
else
|
||||||
|
@studium=Studium.first
|
||||||
end
|
end
|
||||||
|
respond_to do |format|
|
||||||
|
format.html # new.html.erb
|
||||||
|
format.json { render json: @modulgruppe }
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,13 @@ class ModulsController < ApplicationController
|
|||||||
def index
|
def index
|
||||||
@moduls = Modul.all
|
@moduls = Modul.all
|
||||||
if !params[:studium_id].nil?
|
if !params[:studium_id].nil?
|
||||||
@studium=Studium.find(params[:studium_id])
|
@studium=Studium.find(params[:studium_id])
|
||||||
end
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.erb
|
format.html # index.html.erb
|
||||||
format.json { render json: @moduls }
|
format.json { render json: @moduls }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /moduls/1
|
# GET /moduls/1
|
||||||
@@ -27,8 +28,10 @@ class ModulsController < ApplicationController
|
|||||||
# GET /moduls/new.json
|
# GET /moduls/new.json
|
||||||
def new
|
def new
|
||||||
@modul = Modul.new
|
@modul = Modul.new
|
||||||
modulgruppe=Modulgruppe.find(params[:modulgruppen_id])
|
modulgruppe=Modulgruppe.find_by_id(params[:modulgruppen_id])
|
||||||
@modul.modulgruppen<<modulgruppe
|
if !modulgruppe.nil?
|
||||||
|
@modul.modulgruppen<<modulgruppe
|
||||||
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # new.html.erb
|
format.html # new.html.erb
|
||||||
format.json { render json: @modul }
|
format.json { render json: @modul }
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<br />
|
<br>
|
||||||
<% if !@studium.nil? %>
|
<% if !@studium.nil? %>
|
||||||
<%= link_to 'New Modulgruppe', new_modulgruppe_path %>
|
<%= link_to 'New Modulgruppe', new_studium_modulgruppe_path(@studium) %>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<% if !@studium.nil? %>
|
<% #if !@studium.nil? %>
|
||||||
<%= link_to 'New Modul', new_modul_path() %>
|
<%= link_to 'New Modul', new_modul_path() %>
|
||||||
<% end%>
|
<% #end%>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user