I have an array with many DIV ids. I want to highlight all at once. The current... page.visual_effect :highlight, "div_id" only takes one div id. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Tue, Sep 23, 2008 at 2:14 AM, Vapor .. <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>wrote:> > I have an array with many DIV ids. > I want to highlight all at once. > The current... > page.visual_effect :highlight, "div_id" > only takes one div id.Hi, you should be able to do the following: Using RJS: page.array_of_divs.each do |div| page.visual_effect :highlight, div end or page.array_of_divs.each do |div| page[ div ].visual_effect :highlight end Using Prototype Javascript Library: array_of_divs.each( function( value ) { value.visualEffect( "highlight" ); }); Good luck, -Conrad --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> page.array_of_divs.each do |div| > page.visual_effect :highlight, div > endHow do I pass an array from controller? I am using page.-nNdOFoVe1aPcReiJfGmhNQ@public.gmane.org but it doesn''t work some template compile error -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 23 Sep 2008, at 18:56, Vapor .. wrote:> >> page.array_of_divs.each do |div| >> page.visual_effect :highlight, div >> end > > How do I pass an array from controller? > I am using page.-nNdOFoVe1aPcReiJfGmhNQ@public.gmane.org@newitems.each do |item| ... end Fred> > but it doesn''t work > some template compile error > > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---