# Multi-select category listbox

**URL:** <https://www.ruby-forum.com/t/multi-select-category-listbox/151285>\
**Category:** Rails\
**Created:** [October 19, 2008, 8:19pm UTC](https://www.ruby-forum.com/t/multi-select-category-listbox/151285 "2008-10-19T20:19:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![softf5ajivanet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Post date:** [October 19, 2008, 8:19pm UTC](https://www.ruby-forum.com/t/multi-select-category-listbox/151285/1 "2008-10-19T20:19:35Z")

</div>

Hi, on to the final bit of my blogging engine and would really  
appreciate a pointer in the right direction.

With each article they can be associated with multiple categories, so  
inside the admin panel I need to somehow have a listbox that allows  
users to select multiple categories and associated them to an article.

Now I can return an object of all the categories available and one that  
contains all the categories the current article is associated, putting  
that in a listbox and making it save the results is what stumps me.

any ideas?

---

<div class="post-metadata">

**Author:** ![softf5ajivanet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Post date:** [October 19, 2008, 10:33pm UTC](https://www.ruby-forum.com/t/multi-select-category-listbox/151285/2 "2008-10-19T22:33:22Z")

</div>

select\_tag “article[category\_ids][]“,  
options\_from\_collection\_for\_select(@available\_categories, “id”,  
“name”), :multiple=\>true

That should create a select box with multiple selected elements…
