# How to show Category with n childrens in a form

**URL:** <https://www.ruby-forum.com/t/how-to-show-category-with-n-childrens-in-a-form/172674>\
**Category:** Rails\
**Created:** [July 25, 2009, 6:45am UTC](https://www.ruby-forum.com/t/how-to-show-category-with-n-childrens-in-a-form/172674 "2009-07-25T06:45:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![salil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@salil](https://www.ruby-forum.com/u/salil)\
**Post date:** [July 25, 2009, 6:45am UTC](https://www.ruby-forum.com/t/how-to-show-category-with-n-childrens-in-a-form/172674/1 "2009-07-25T06:45:13Z")

</div>

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 G.

---

<div class="post-metadata">

**Author:** ![salil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@salil](https://www.ruby-forum.com/u/salil)\
**Post date:** [July 25, 2009, 7:43am UTC](https://www.ruby-forum.com/t/how-to-show-category-with-n-childrens-in-a-form/172674/2 "2009-07-25T07:43:14Z")

</div>

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 [www.optimalsturm.com](http://www.optimalsturm.com)

Demonstration  
out-of-the-box demo application at  
[http://github.com/funkensturm/funkengallery\_demo](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

On 25 juil, 06:45, Salil G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
