# Observe(ing)\_fild a collection\_select with 1 item

**URL:** <https://www.ruby-forum.com/t/observe-ing-fild-a-collection-select-with-1-item/88509>\
**Category:** Rails\
**Created:** [March 12, 2007, 6:57am UTC](https://www.ruby-forum.com/t/observe-ing-fild-a-collection-select-with-1-item/88509 "2007-03-12T06:57:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorge\_Mario\_GSMazo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/71c47a/32.png) [@Jorge\_Mario\_GSMazo](https://www.ruby-forum.com/u/Jorge_Mario_GSMazo)\
**Post date:** [March 12, 2007, 6:57am UTC](https://www.ruby-forum.com/t/observe-ing-fild-a-collection-select-with-1-item/88509/1 "2007-03-12T06:57:41Z")

</div>

Hi there  
I’m obseving a field (a collection select) and it work if the  
collection has more than one item, if it has only one it wont change  
anything here is my code

\<%= collection\_select ‘address’, ‘address’, @addresses, :id, :address  
%\>

  
\<%= observe\_field(  
:address\_address,  
:update =\> ‘shipping’,  
:url =\> { :action =\> :shi },  
:complete =\> “new Effect.SlideDown(‘shipping’)”,  
:with =\> ‘boo’) %\>

As I read that obseve\_fields take the same arguments of link\_to\_remote  
i have tried :on =\> click  
focus  
change  
but no luck  
if there is only one item in the collection it wont work

## thanks in advance

Jorge Mario G. Mazo
