How do I store the value of multiple checkboxes as a result of using
"check_box" helper in a "Search" class? A "Search" class is explained
here: #111 Advanced Search Form - RailsCasts. For
example, a user should be able to search for all "Gay" OR "Bisexual"
users by clicking both checkboxes. These are values of attribute
"orientation". My own research shows that I should do something like
this:
Store Search[:orientations] in the database in "text".
In the search form:
Will this work? I have not implemented this but I would like to know
if this is the right direction. I already see one problem: How does
the search form remember the checkboxes that the user has checked?
Unlike the radio_button helper where if the current value of method is
tag_value the radio button will be checked, I don't see where
check_box examines the current value of orientations from the
database.
Can some one help me with this question below? Thanks.
How do I store the value of multiple checkboxes as a result of using
"check_box" helper in a "Search" class? A "Search" class is explained
here: #111 Advanced Search Form - RailsCasts. For
example, a user should be able to search for all "Gay" OR "Bisexual"
users by clicking both checkboxes. These are values of attribute
"orientation". My own research shows that I should do something like
this:
Store Search[:orientations] in the database in "text".
In the search form:
Will this work? I have not implemented this but I would like to know
if this is the right direction. I already see one problem: How does
the search form remember the checkboxes that the user has checked?
Unlike the radio_button helper where if the current value of method is
tag_value the radio button will be checked, I don't see where
check_box examines the current value of orientations from the
database.