Display datas from database using List box

HI,

i need to diaplay data’s in a List box. actuall i don’t know coding
for List box. if its combox box means i can use collection_select. so
can anyonel tell this- urgent

i need to diaplay data’s in a List box. actuall i don’t know coding
for List box. if its combox box means i can use collection_select. so
can anyonel tell this- urgent
You can use collection_select for this:

collection_select(‘object’, ‘method’, @panels, :id, :name, {},
{:multiple => ‘multiple’})

Also, it is sometimes considered quite rude to post messages with
‘urgent’ in them (as you have done in your last 3 posts). The
response from this group is normally very quick as everyone is happy
to help, regardless of urgency on your part.

Steve

hi,

i got the answer when i user the panel table. 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

Stephen B. wrote:

i need to diaplay data’s in a List box. actuall i don’t know coding
for List box. if its combox box means i can use collection_select. so
can anyonel tell this- urgent
You can use collection_select for this:

collection_select(‘object’, ‘method’, @panels, :id, :name, {},
{:multiple => ‘multiple’})

Also, it is sometimes considered quite rude to post messages with
‘urgent’ in them (as you have done in your last 3 posts). The
response from this group is normally very quick as everyone is happy
to help, regardless of urgency on your part.

Steve