views:

178

answers:

1

G'day guys, I'm having an issue with filtering the presentation of several thousand trade items I have in my system. As per the specs of the system we're building we have to have a form that allows people to put in a start date and then an interval in minutes, to filter the presentation of the items. I've built my helper functions to return all of the trades within that interval period, but I can't for the life of me properly build the form that will return a dateTime value and an integer value within the top of the index page?

Any ideas? Would I have to build a separate model object to assign values to, or is there a simpler way?

A: 

On your index page you can form like this

<% form_tag '', :method => :get do %>
  <%= text_field_tag :value_one %>
  <%= text_field_tag :value_two %>
  <%= submit_tag 'Filter' %>
<% end %>

Your form will then do a GET on your page with query string parameters and then in your controller you can look for the filter parameters that might have been passed.

Corey