Hello,
Please be prepared for some very basic, very newbie, very
HTML-beginner, knows-nothing-about-AJAX questions…
I have a (RESTful, if it makes any difference) application that
displays a ton of data (names of documents) on the index page.
I would like to limit the amount of data displayed, by adding a SELECT
box that narrows the list of data down by selecting a category.
Each category has a user defined min & max field, that is used to
select rows out of my table. (The category table is also stored in my
database).
Ideally, I would like to produce a URL that looks like
http://site/documents?min=1?max=99, so that it could be bookmarked
appropriately.
Here’s my question… where do I start?
OK, I can narrow that down a little bit…
In my index view, I think I need to include a form with a “go” button,
but I don’t really think I can use a “form_for” construct, as this is
not a form for my documents controller, so I have:
<% form_tag(documents_path, {:method => :get}) do %>
<%= submit_tag “Go” %>
<% end %>
I noticed very quickly that I needed the “:method => :get” option, as
I ended up creating a blank record the first time I tried this
My narrower, more specific questions go like this:
a) Is it possible to specify an option to “submit_tag” so that I don’t
get “?commit=go” appended to the URL?
b) Which of the various select methods should I use to select items
from a separate table?
c) Is there a way to select a pair of values (min & max) with that one
select tag?
d) Am I making this more difficult than I need to?
–wpd