# Prototype/script-atulo-us guidance needed, I think

**URL:** <https://www.ruby-forum.com/t/prototype-script-atulo-us-guidance-needed-i-think/186417>\
**Category:** Rails\
**Created:** [April 6, 2010, 9:49pm UTC](https://www.ruby-forum.com/t/prototype-script-atulo-us-guidance-needed-i-think/186417 "2010-04-06T21:49:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [April 6, 2010, 9:49pm UTC](https://www.ruby-forum.com/t/prototype-script-atulo-us-guidance-needed-i-think/186417/1 "2010-04-06T21:49:32Z")

</div>

Hi,

I’ve got an app\views\expenses\new.html.erb file displayed at  
[http://www.pastie.org/906145](http://www.pastie.org/906145).  
Q1: Lines 22-26, repeated here create a drop-down list of “vendor  
names” in true Ajax fashion: they push all lower-positioned items  
south to make room for the vendor names being created. I’d rather  
cover the lower items while the drop-down is visible, and restore the  
covered item when the drop-down closes.

22:

  
23: \<%= select\_tag “list”,  
24: options\_for\_select(@current\_vendors),  
25: :multiple =\> true %\>  
26: 

I tried to modify line 25 to:  
25: :multiple =\> true, :z-index =\> 2 %\>  
but that and other forms yielded syntax-error responses.

Q2:. I generated the content of @current\_vendors with code in line 14:  
14: \<% @current\_vendors = Vendor.find(:all).collect { |vendor|  
vendor.nickname } %\>

I’d like to each current\_vendors item to be a button whose:  
(i) toString method was invoked by options\_for\_select for presentation  
purposes; and  
(ii) onClick method invoke a specified function that:  
a. copied the nickname in the drop-down to another text-box; and  
b. invoked the toggle routine on the drop-down structure (the  
toggling currently works).

I poked around in books and online for an example of this kind of  
thing, but to no avail thus far. Any suggestions on where to look or  
how to implement this functionality.

Thanks in Advance,  
Richard

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [April 7, 2010, 7:19pm UTC](https://www.ruby-forum.com/t/prototype-script-atulo-us-guidance-needed-i-think/186417/2 "2010-04-07T19:19:11Z")

</div>

## Last night, Ed from the B’more on Rails meetup group gave me the key idea: use ActiveRecord::Observer. So I’m working on doing that. If you post any details about how to do that before I figure it out from the documentation, I’d appreciate any such feedback.

Richard

On Apr 6, 3:47 pm, RichardOnRails
