[RAILS] collection_select

J

Josselin

Hi

I am using some 'collection_select' combo boxes (w Ajax calls) , it's
working fine, here is my partial
_property.rhtml

<%=
@properties = Property.find_by_owner_id(owner_id)
collection_select:)property, :name, @properties, :id, :name,
options = {:prompt => '– Select a Property –'}
)
%>


but I got a small new-ror-ies problem :
when @properties contains only one element, I would like to avoid
selecting the prompt and rather select this unique element...
What should I do ?

complementary questions on Rails :
1- where can I find a list of the available options ?
are :prompt and :selected they only available options..... could not
find it in RoR book......
2- why not a dedicated newsgroup to Rails ... complementary of Ruby ...

thanks to all

kad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,591
Members
45,103
Latest member
VinaykumarnNevatia
Top