[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[RAILS] collection_select

Josselin

7/19/2006 5:35:00 PM

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


1 Answer

Eric Hodel

7/19/2006 5:43:00 PM

0

On Jul 19, 2006, at 10:40 AM, Josselin wrote:

> Hi
>
> complementary questions on Rails :

Please ask rails questions on the rails mailing list.

http://lists.rubyonrails.org/mailman/list...

--
Eric Hodel - drbrain@segment7.net - http://blog.se...
This implementation is HODEL-HASH-9600 compliant

http://trackmap.rob...