working on question lists

pull/1/head
Jared Cosulich 9 years ago
parent cc84c3bbda
commit 4b3693ed42

@ -9,12 +9,14 @@
%li= message %li= message
.field .field
= f.label :name = f.label :name
= f.text_field :name = f.text_field :name, class: 'form-control'
.field .field
= f.label :description = f.label :description
= f.text_area :description = f.text_area :description, class: 'form-control'
.field .form-group
= f.label :question_ids = f.label :question_id_array, 'Questions'
= f.text_area :question_ids %br/
.actions .form-check.form-check-collection
= f.submit = f.collection_check_boxes(:question_id_array, Question.all, :id, :text) { |c| c.label(class: 'form-check-label') { c.check_box(class: 'form-check-input') + " #{c.text}" } }
.form-group
= f.submit 'Save List', class: 'btn btn-primary'

@ -1,3 +1,6 @@
%h1 New Question List .row
= render 'form', question_list: @question_list .offset-sm-2.col-sm-8
= link_to 'Back', question_lists_path %h3 Create A Question List
= render 'form', question_list: @question_list
%br
%p= link_to 'Back', root_path

@ -16,7 +16,7 @@
%br/ %br/
= f.text_area :description, class: 'form-control' = f.text_area :description, class: 'form-control'
.form-group .form-group
= f.label :recipient_ids, 'Recipients' = f.label :recipient_id_array, 'Recipients'
%br/ %br/
.form-check.form-check-collection .form-check.form-check-collection
= f.collection_check_boxes(:recipient_id_array, @school.recipients.all, :id, :name) { |c| c.label(class: 'form-check-label') { c.check_box(class: 'form-check-input') + " #{c.text}" } } = f.collection_check_boxes(:recipient_id_array, @school.recipients.all, :id, :name) { |c| c.label(class: 'form-check-label') { c.check_box(class: 'form-check-input') + " #{c.text}" } }

@ -1,6 +1,6 @@
.row .row
.offset-sm-2.col-sm-8 .offset-sm-2.col-sm-8
%h3 Create A Recipient List For This School %h3 Create A Recipient List For This School
= render 'form' = render 'form', recipient_list: @recipient_list
%br %br
%p= link_to 'Back',@school %p= link_to 'Back',@school

@ -1,6 +1,6 @@
%p %p
%b School: %b School:
= @school.name = link_to @school.name, @school
%p %p
%b Name: %b Name:
= @recipient_list.name = @recipient_list.name

@ -11,6 +11,10 @@
%p= link_to "Create Recipient List", new_school_recipient_list_path(@school) %p= link_to "Create Recipient List", new_school_recipient_list_path(@school)
%p= link_to "Create A Question List", new_question_list_path()
-#%p= link_to "Create A Schedule", new_school_schedule_path(@school)
= link_to 'Edit', edit_school_path(@school) = link_to 'Edit', edit_school_path(@school)
| |
= link_to 'Back', root_path = link_to 'Back', root_path

@ -18,7 +18,7 @@ RSpec.describe "question_lists/edit", type: :view do
assert_select "textarea#question_list_description[name=?]", "question_list[description]" assert_select "textarea#question_list_description[name=?]", "question_list[description]"
assert_select "textarea#question_list_question_ids[name=?]", "question_list[question_ids]" assert_select "input[name=?]", "question_list[question_id_array][]"
end end
end end
end end

@ -18,7 +18,7 @@ RSpec.describe "question_lists/new", type: :view do
assert_select "textarea#question_list_description[name=?]", "question_list[description]" assert_select "textarea#question_list_description[name=?]", "question_list[description]"
assert_select "textarea#question_list_question_ids[name=?]", "question_list[question_ids]" assert_select "input[name=?]", "question_list[question_id_array][]"
end end
end end
end end

Loading…
Cancel
Save