Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Multiple checkboxes for ruby array
serialize :storage_type
:storage_type => []
#STORE = model
<div class="field">
<%= check_box("store", :storage_type, {:multiple => true}, "Self Storage", nil) %> Self Storage
<%= check_box("store", :storage_type, {:multiple => true}, "fetch", nil) %> fetch
<%= check_box("store", :storage_type, {:multiple => true}, "roll_over", nil) %> roll_over
<div class="field">
<input checked="checked" id="store_storage_type_self_storage" name="store[storage_type][]" type="checkbox" value="Self Storage"> Self Storage
<input checked="checked" id="store_storage_type_fetch" name="store[storage_type][]" type="checkbox" value="fetch"> fetch
<input checked="checked" id="store_storage_type_roll_over" name="store[storage_type][]" type="checkbox" value="roll_over"> roll_over
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.