Created
July 4, 2011 04:01
-
-
Save matatabi/1062902 to your computer and use it in GitHub Desktop.
multiple checkboxes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
serialize :product_categories | |
<%= select_product_categories(@vendor.registration_request.product_categories) %> | |
def select_product_categories(array) | |
if array == nil or array.length == 0 | |
array = [] | |
end | |
html = "" | |
for pc in PRODUCT_CATEGORIES_JP | |
html << "<div class='fixed_cell'>#{check_box_tag 'vendor[registration_request_attributes][product_categories][]', pc, array.include?(pc)} #{pc}</div>" | |
end | |
return raw html | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment