Safeguards
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
# updated_at :datetime not null
|
# updated_at :datetime not null
|
||||||
class Studium < ActiveRecord::Base
|
class Studium < ActiveRecord::Base
|
||||||
attr_accessible :desc, :name, :typ, :zahl
|
attr_accessible :desc, :name, :typ, :zahl
|
||||||
has_many :modulgruppen, inverse_of: :studium, :class_name => "Modulgruppe"
|
has_many :modulgruppen, inverse_of: :studium, :class_name => "Modulgruppe", :dependent => :destroy
|
||||||
has_many :semester, :dependent => :destroy
|
has_many :semester, :dependent => :destroy
|
||||||
|
|
||||||
validates :typ, :inclusion => {:in => ["Bachelor","Master"] }
|
validates :typ, :inclusion => {:in => ["Bachelor","Master"] }
|
||||||
|
|||||||
@@ -1,16 +1,28 @@
|
|||||||
|
|
||||||
<% @modul.modulgruppen.each do |g| %>
|
|
||||||
<ul class="breadcrumb">
|
<ul class="breadcrumb">
|
||||||
<li>
|
<% @modul.modulgruppen.each do |g| %>
|
||||||
<%= link_to g.studium.name , studium_path(g.studium)%> <span class="divider">/</span></li>
|
<% if !g.nil? %>
|
||||||
<li><%= link_to g.name , modulgruppe_path(g)%></li>
|
<li>
|
||||||
<%end%>
|
<% if !g.studium.nil? %>
|
||||||
|
<%= link_to g.studium.name , studium_path(g.studium) %>
|
||||||
|
|
||||||
|
<% else %>
|
||||||
|
<li>Studium fehlt!
|
||||||
|
<% end %>
|
||||||
|
<span class="divider">/</span></li>
|
||||||
|
<li><%= link_to g.name , modulgruppe_path(g)%>
|
||||||
|
<% else %>
|
||||||
|
<li>Modulgruppe Fehlt
|
||||||
|
<%end %>
|
||||||
|
<span class="divider">/</span> </li>
|
||||||
|
<%end%>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p id="notice"><%= notice %></p>
|
<p id="notice"><%= notice %></p>
|
||||||
<%= render @modul %>
|
<%= render @modul %>
|
||||||
|
|
||||||
|
<%= render 'layouts/pretty_toolbar' %>
|
||||||
<%= link_to 'Add LVA', new_lva_path(:modul_id =>@modul.id) %>
|
<% # link_to 'Add LVA', %>
|
||||||
<%= link_to '<i class="icon-pencil"></i>'.html_safe+ I18n.t("common.edit") , edit_modul_path(@modul) %>
|
<% # link_to '<i class="icon-pencil"></i>'.html_safe+ I18n.t("common.edit") , edit_modul_path(@modul) %>
|
||||||
<%= link_to "Loeschen", [@modul],:method=>:delete ,:data => {:confirm =>"Are you sure" } %>
|
<% # link_to "Loeschen", [@modul],:method=>:delete ,:data => {:confirm =>"Are you sure" } %>
|
||||||
|
|||||||
Reference in New Issue
Block a user