# Problem with to list the data's in a list box

**URL:** <https://www.ruby-forum.com/t/problem-with-to-list-the-datas-in-a-list-box/83882>\
**Category:** Rails\
**Created:** [January 30, 2007, 1:39pm UTC](https://www.ruby-forum.com/t/problem-with-to-list-the-datas-in-a-list-box/83882 "2007-01-30T13:39:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ror](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ee59a6/32.png) [@ror](https://www.ruby-forum.com/u/ror)\
**Post date:** [January 30, 2007, 1:39pm UTC](https://www.ruby-forum.com/t/problem-with-to-list-the-datas-in-a-list-box/83882/1 "2007-01-30T13:39:38Z")

</div>

hi,

i got the answer when i user the panel table for the list boxes. but  
when i have to use Demogaphic\_categories table. if i use this it shows  
the error in

Expected ./app/models/demographic\_category.rb to define  
Demographic\_category

```
Like this.

```

dataBase name is - Demographic\_categories

fields - id, name, allow\_multiple

my coding:

index.rhtml

\<%= collection\_select(‘object’, ‘method’, @demographic\_categories, :id,  
:name, {},  
{:multiple =\> ‘multiple’}) %\>

in controller:

@demographic\_categories=Demographic\_category.find(:all);

```
can u tell this what's the error in this? please
```

---

<div class="post-metadata">

**Author:** ![ror](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ee59a6/32.png) [@ror](https://www.ruby-forum.com/u/ror)\
**Post date:** [January 30, 2007, 1:43pm UTC](https://www.ruby-forum.com/t/problem-with-to-list-the-datas-in-a-list-box/83882/2 "2007-01-30T13:43:23Z")

</div>

You need demographic\_categories as the table name and  
DemographicCategory as the model name.

---

<div class="post-metadata">

**Author:** ![ror](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ee59a6/32.png) [@ror](https://www.ruby-forum.com/u/ror)\
**Post date:** [January 30, 2007, 1:57pm UTC](https://www.ruby-forum.com/t/problem-with-to-list-the-datas-in-a-list-box/83882/3 "2007-01-30T13:57:48Z")

</div>

hi,

thanks for ur reply. yes i have the demographic\_category table and  
model name. i rellay don’t know still why its not working.

Mick S. wrote:

> You need demographic\_categories as the table name and  
> DemographicCategory as the model name.

---

<div class="post-metadata">

**Author:** ![ror](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ee59a6/32.png) [@ror](https://www.ruby-forum.com/u/ror)\
**Post date:** [January 31, 2007, 5:42am UTC](https://www.ruby-forum.com/t/problem-with-to-list-the-datas-in-a-list-box/83882/4 "2007-01-31T05:42:43Z")

</div>

hi,

my error is

Expected ./app/models/demographic\_category.rb to define  
Demographic\_category

but i have the Demographic\_category model. i don’t know why is not  
working?

Mick S. wrote:

> What error message are you getting now?

---

<div class="post-metadata">

**Author:** ![ror](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ee59a6/32.png) [@ror](https://www.ruby-forum.com/u/ror)\
**Post date:** [January 30, 2007, 2:07pm UTC](https://www.ruby-forum.com/t/problem-with-to-list-the-datas-in-a-list-box/83882/5 "2007-01-30T14:07:32Z")

</div>

What error message are you getting now?

---

<div class="post-metadata">

**Author:** ![ror](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ee59a6/32.png) [@ror](https://www.ruby-forum.com/u/ror)\
**Post date:** [January 31, 2007, 7:42am UTC](https://www.ruby-forum.com/t/problem-with-to-list-the-datas-in-a-list-box/83882/6 "2007-01-31T07:42:43Z")

</div>

hi,

i got the answer.

ROR wrote:

> hi,
> 
> my error is
> 
> Expected ./app/models/demographic\_category.rb to define  
> Demographic\_category
> 
> but i have the Demographic\_category model. i don’t know why is not  
> working?
> 
> Mick S. wrote:
> 
> > What error message are you getting now?
