Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #104 from MITLibraries/97_switch_to_checkboxes
Browse files Browse the repository at this point in the history
Switch from Select Multiple to Checkboxes
  • Loading branch information
JPrevost committed Apr 1, 2016
2 parents 00f4960 + c811875 commit b93ad95
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ ruby '2.3.0'

gem 'rails', '4.2.6'
gem 'aws-sdk', '~> 2'
gem 'bootstrap_form'
gem 'bootstrap_form', git: 'https://github.com/MITLibraries/rails-bootstrap-forms',
branch: 'use_parameterize_for_check_box_label_for'
gem 'cancancan'
gem 'delayed_job_active_record'
gem 'devise'
Expand Down
10 changes: 8 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
GIT
remote: https://github.com/MITLibraries/rails-bootstrap-forms
revision: a666d4e3baf0b9f612a82a586e862bbe867793e9
branch: use_parameterize_for_check_box_label_for
specs:
bootstrap_form (2.3.0)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -50,7 +57,6 @@ GEM
aws-sdk-resources (2.2.28)
aws-sdk-core (= 2.2.28)
bcrypt (3.1.11)
bootstrap_form (2.3.0)
builder (3.2.2)
byebug (8.2.2)
cancancan (1.13.1)
Expand Down Expand Up @@ -294,7 +300,7 @@ PLATFORMS
DEPENDENCIES
annotate
aws-sdk (~> 2)
bootstrap_form
bootstrap_form!
byebug
cancancan
coveralls
Expand Down
9 changes: 5 additions & 4 deletions app/views/submissions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
label: 'Publication Date',
help: 'If not yet published, please enter an estimated Publication Date.'%>
<%= f.select :funders,
options_for_select(@submission.valid_funders, @submission.funders),
{ include_hidden: false, help: 'Multiple funder selections are allowed' },
{ multiple: true, size: 13 } %>
<%= f.form_group :funders, label: { text: 'Funders' } do %>
<% @submission.valid_funders.each do |funder| %>
<%= f.check_box(:funders, { multiple: true, label: funder }, funder, nil ) %>
<% end %>
<% end %>
<%= f.file_field :documents, multiple: true,
help: 'Drag and Drop files or click "Choose Files"' %>
Expand Down
2 changes: 1 addition & 1 deletion test/features/submission_create_pages_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def base_valid_form
visit new_submission_path
fill_in('Journal', with: 'Super Mega Journal')
fill_in('Title', with: 'Alphabetical Order is Good Enough')
select 'Department of Energy (DOE)', from: 'submission_funders'
check('Department of Energy (DOE)')
select '1999', from: 'submission[pub_date(1i)]'
select 'January', from: 'submission[pub_date(2i)]'
Timecop.return
Expand Down

0 comments on commit b93ad95

Please sign in to comment.