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
|
||||
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"
|
||||
has_and_belongs_to_many :moduls
|
||||
|
||||
|
||||
@@ -1,25 +1,29 @@
|
||||
<%= semantic_form_for @modulgruppe do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<div class="span8">
|
||||
<%= f.inputs do %>
|
||||
<div class="span8">
|
||||
|
||||
<div class="row-fluid">
|
||||
<%= f.input :name, :wrapper_html=>{:class=>"span12"}%>
|
||||
<div class="row-fluid">
|
||||
<%= f.input :studium_id, :as =>:select, :collection => Studium.all, :wrapper_html=>{:class=>"span4"} %>
|
||||
<%= f.input :typ, :collection=>["Pflicht","Vertiefungspflicht","Wahl"], :wrapper_html=>{:class=>"span4"}%>
|
||||
<%= f.input :phase, :as=>:select, :collection=>1..3, :wrapper_html=>{:class=>"span4"} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<%= f.input :name, :wrapper_html=>{:class=>"span12"}%>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<%= f.input :studium_id, :as =>:select, :collection => Studium.all, :wrapper_html=>{:class=>"span4"} %>
|
||||
<%= f.input :typ, :collection=>["Pflicht","Vertiefungspflicht","Wahl"], :wrapper_html=>{:class=>"span4"}%>
|
||||
<%= f.input :phase, :as=>:select, :collection=>1..3, :wrapper_html=>{:class=>"span4"} %>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row-fluid">
|
||||
<%= f.input :desc %>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="row-fluid">
|
||||
<%= f.input :desc %>
|
||||
|
||||
</div>
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :input %>
|
||||
|
||||
</div>
|
||||
<div class="span4">
|
||||
<%= f.input :moduls, :as=>:check_boxes %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :input %>
|
||||
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user