Hi, I’ve got an app\views\expenses\new.html.erb file displayed at 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: <div id="vendor_droplist" style="display:none"> 23: <%= select_tag "list", 24: options_for_select(@current_vendors), 25: :multiple => true %> 26: </div> 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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
RichardOnRails
2010-Apr-07 17:17 UTC
Re: Prototype/script-atulo-us guidance needed, I think.
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 <RichardDummyMailbox58...-FtJgd9dCuO3JTKoYRCtP1UEOCMrvLtNR@public.gmane.org> wrote:> Hi, > > I’ve got an app\views\expenses\new.html.erb file displayed athttp://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: <div id="vendor_droplist" style="display:none"> > 23: <%= select_tag "list", > 24: options_for_select(@current_vendors), > 25: :multiple => true %> > 26: </div> > > 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-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.