From ce21f00597f1ed93723d8eec12af84993fd294db Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Fri, 12 Apr 2013 13:18:31 -0400 Subject: [PATCH] Update form to accept sections --- app/views/alerts/_form.html.erb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/views/alerts/_form.html.erb b/app/views/alerts/_form.html.erb index 5937420..79d38f4 100644 --- a/app/views/alerts/_form.html.erb +++ b/app/views/alerts/_form.html.erb @@ -1,4 +1,7 @@ <%= form_for @alert, :html => { :class => 'form-horizontal' } do |f| %> + <% if @alert.errors.any? %> + <%= @alert.errors.full_messages.join(',') %> + <% end %>
<%= f.label :department, :class => 'control-label' %>
@@ -11,6 +14,18 @@ <%= f.text_field :course, :class => 'text_field' %>
+
+ <%= f.label :sections, :class => 'control-label' %> +
+ <% 3.times do |key| %> + <%= text_field_tag( + 'alert[sections][]', + params[:section] ? params[:section][key] : @alert.sections[key], + :class => 'text_field, span1' + ) %> + <% end %> +
+
<%= f.label :semester, :class => 'control-label' %>