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