forked from bofh/fetsite
Module können Modulgruppen auch per form hinzugefügt werden
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
class Modulgruppe < ActiveRecord::Base
|
class Modulgruppe < ActiveRecord::Base
|
||||||
attr_accessible :name, :phase, :typ,:desc, :studium_id
|
attr_accessible :name, :phase, :typ,:desc, :studium_id, :modul_ids
|
||||||
belongs_to :studium, :foreign_key => "studium_id"
|
belongs_to :studium, :foreign_key => "studium_id"
|
||||||
has_and_belongs_to_many :moduls
|
has_and_belongs_to_many :moduls
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +1,29 @@
|
|||||||
<%= semantic_form_for @modulgruppe do |f| %>
|
<%= semantic_form_for @modulgruppe do |f| %>
|
||||||
<%= f.inputs do %>
|
<%= f.inputs do %>
|
||||||
<div class="span8">
|
<div class="span8">
|
||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<%= f.input :name, :wrapper_html=>{:class=>"span12"}%>
|
<%= f.input :name, :wrapper_html=>{:class=>"span12"}%>
|
||||||
<div class="row-fluid">
|
</div>
|
||||||
<%= f.input :studium_id, :as =>:select, :collection => Studium.all, :wrapper_html=>{:class=>"span4"} %>
|
<div class="row-fluid">
|
||||||
<%= f.input :typ, :collection=>["Pflicht","Vertiefungspflicht","Wahl"], :wrapper_html=>{:class=>"span4"}%>
|
<%= f.input :studium_id, :as =>:select, :collection => Studium.all, :wrapper_html=>{:class=>"span4"} %>
|
||||||
<%= f.input :phase, :as=>:select, :collection=>1..3, :wrapper_html=>{:class=>"span4"} %>
|
<%= f.input :typ, :collection=>["Pflicht","Vertiefungspflicht","Wahl"], :wrapper_html=>{:class=>"span4"}%>
|
||||||
</div>
|
<%= f.input :phase, :as=>:select, :collection=>1..3, :wrapper_html=>{:class=>"span4"} %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<%= f.input :desc %>
|
<%= f.input :desc %>
|
||||||
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<%= f.actions do %>
|
|
||||||
<%= f.action :submit, :as => :input %>
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="span4">
|
||||||
|
<%= f.input :moduls, :as=>:check_boxes %>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<%= f.actions do %>
|
||||||
|
<%= f.action :submit, :as => :input %>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user