Filter collection based on field value in the index.rhtml

Hi,

I am using Rails 1.2.6

i have an items controller.

i am using the templated index.rhtml so it displays everything in my
items table

each item has the following fields in database.
id
name
category which is non unique
price

what i need is let say there is a drop down list in the index.rhtml
which contains all the possible values of category in the items table.
(I have managed this.)

inside this drop down list it contains say 3 possible values of
category and the value ‘ALL’

when a user chooses the value in the drop down, i need the items that
are displayed in this index.rhtml to change accordingly.

Eg, if the user chooses the category ‘household’

the page will only display items whose category is of the value
household.

if the user chooses ‘ALL’

the page will display all.

I am open to either ajax or a full postback. Please advise me as to
how to get the effect I want.

Please advise.

Thank you.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs