AJAX - how to have multiple select form sets implemented?

hi, there :slight_smile:

Consider a blogging application whereby a user is trying to add a new

He/she has to select a category. Upon selecting a category from a drop
down box, a new sub categories drop down box will be created (hence an
AJAX call). Got this implemented and it’s ok.

Now, let’s assume that a given blog can have multiple categories (and
For example, a blog on a restaurant review can belong to the following
categories & subcategories:

  1. “food” -> “fine dining”
  2. “people” -> “lifestyle”
  3. “travelling” -> “restaurants”

After selecting a set of category and sub category, there will be a
link entitled, “add another category/subcategory” (I guess this can be
done with link_to_remote or something).

My question is, how do you code it such that upon clicking on the link
mentioned, another category drop down box will be displayed in the
form. Selecting a category value would then cause a sub categories
drop down box to appear in the same form allowing the user to select
another sub category. Again, the link entitled, “add another category/
subcategory” will also be shown.

How do I go abouts implementing this? I know it’s a call to use AJAX
but I don’t exactly know how. I have tried reading up some rails books
and cookbooks to no success.

Please help!! :slight_smile: