Hi, I have many pages that list information (modified from the
scaffolding). I would like to include a box at the top of these pages
that has some search criteria with drop downs, date ranges, etc.
When the user submits, the controller then adds appropriate conditions
to the find method, and the matching records are displayed with the
search form maintaining the users selections.
I have been messing around with something like the following:
Search Criteria
<%= start_form_tag :action => "list" %> Status: <%= select "search", "status", @statuses, :prompt => '-All-' %>Assignee: <%= select "search", "assignee", @assignees.collect { |u| [u.name, u.id] }, :prompt => '-All-' %>
#... <%= submit_tag "find" %> <%= end_form_tag %>
Am I on the right track, or does anyone have a good way of doing this?