Okay so I have a typical search page where a keyword is entered and results are retrieved that match the keyword. What I want to do now is have checkboxes to search for results in specific areas (my site is a big events calendar with "streams" and "audiences") I want to use the checkboxes to look for results in 'streams', 'audiences', or both. I want to be able to return either true or false from a method depending on whether or not a box is checked. I have no idea how to do this, I've only used checkboxes with a database before, and I don't want to use columns in a database for this.
This is my setup so far:
in search view:
[code=]<% form_for :event do |f| %> <label for="stream_search">Search Streams</label> <%= f.check_box :search_streams, {:class=> "check"} %><br /> <label for="aud_search">Search Audiences</label> <%= f.check_box :search_auds, {:class=> "check"} %> <br /> <% end %>[/code]
and I want to be able to somehow get these methods in the event model to return either true or false depending on the checkboxes so I can use them in if-statements in my search method: [code=] def search_streams true
end
def search_auds true
end[/code]
Thanks in advance for any help!