How to show Category with n childrens in a form

Hi All,
I want to show the categories in a form which has n no. of childrens
with n no. of chain. for ex.

category1
         ---category2
                     ---category3
                     ---category4
         ---category5
                      ---category6
                      ---category7
                                  ---category8
                                              ..... and so on.........

what is a best way to show this so that user can easily recognize what
category is he selected. idon't want to show all the categories in same
drop-down because it gets difficult for user to find required category
and also he also not came to know that whcih parent category it belongs.

Regards,

Salil Gaikwad

use acts_as_category
  acts_as_category (Version 1.0)

*acts_as_category*, is yet another acts_as plugin for Ruby on Rails
ActiveRecord models. Copyright is 2009 by <a href="http://
www.optimalsturm.com">www.optimalsturm.com

Demonstration
out-of-the-box demo application at http://github.com/funkensturm/funkengallery_demo

--- quoted --

If everything is set up, you can actually use the plugin. Let's say
you have trees like this and your model is called *Category*.

  root1 root2
   \_ child1 \_ child2
        \_ subchild1 \subchild3
        \_ subchild2 \subchild4