1
0
Fork 0

Update form to accept sections

This commit is contained in:
Andrew Tomaka 2013-04-12 13:18:31 -04:00
parent a4a6e58bab
commit ce21f00597

View file

@ -1,4 +1,7 @@
<%= form_for @alert, :html => { :class => 'form-horizontal' } do |f| %> <%= form_for @alert, :html => { :class => 'form-horizontal' } do |f| %>
<% if @alert.errors.any? %>
<%= @alert.errors.full_messages.join(',') %>
<% end %>
<div class="control-group"> <div class="control-group">
<%= f.label :department, :class => 'control-label' %> <%= f.label :department, :class => 'control-label' %>
<div class="controls"> <div class="controls">
@ -11,6 +14,18 @@
<%= f.text_field :course, :class => 'text_field' %> <%= f.text_field :course, :class => 'text_field' %>
</div> </div>
</div> </div>
<div class="control-group">
<%= f.label :sections, :class => 'control-label' %>
<div class="controls">
<% 3.times do |key| %>
<%= text_field_tag(
'alert[sections][]',
params[:section] ? params[:section][key] : @alert.sections[key],
:class => 'text_field, span1'
) %>
<% end %>
</div>
</div>
<div class="control-group"> <div class="control-group">
<%= f.label :semester, :class => 'control-label' %> <%= f.label :semester, :class => 'control-label' %>
<div class="controls"> <div class="controls">