I am trying to write a little rjs template that toggles a div. Aha: page[:div_id].toggle I hear you cry, and yes it works, but what I am trying to do is the equivalent of: Effect.toggle(''div_id'', ''blind'') Can anybody tell me have to write this in a rjs template?? Any help great fully received. David. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
according to: http://api.rubyonrails.org/classes/ActionView/Helpers/ScriptaculousHelper.html there is a toggle visual effect of :toggle_blind but it''s a scriptaculous helper, not a prototype helper. so try page[:div_id].visual_effect(:toggle_blind) or page.visual_effect :toggle_blind, ''div_id'' if all else fails page.call ''Effect.toggle'', ''div_id'', ''blind'' should do the trick. On 3/3/07, Dave M <moose56-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I am trying to write a little rjs template that toggles a div. > > Aha: > > page[:div_id].toggle > > I hear you cry, and yes it works, but what I am trying to do is the > equivalent of: > > Effect.toggle(''div_id'', ''blind'') > > Can anybody tell me have to write this in a rjs template?? > > Any help great fully received. > > David. > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Many thanks, both of these worked:> page.visual_effect :toggle_blind, ''div_id'' > > page.call ''Effect.toggle'', ''div_iDavid, On 3 Mar 2007, at 13:49, Chris Hall wrote:> > according to: > > http://api.rubyonrails.org/classes/ActionView/Helpers/ > ScriptaculousHelper.html > > there is a toggle visual effect of :toggle_blind but it''s a > scriptaculous helper, not a prototype helper. so try > > page[:div_id].visual_effect(:toggle_blind) > > or > > page.visual_effect :toggle_blind, ''div_id'' > > if all else fails > > page.call ''Effect.toggle'', ''div_id'', ''blind'' > > should do the trick. > > On 3/3/07, Dave M <moose56-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> I am trying to write a little rjs template that toggles a div. >> >> Aha: >> >> page[:div_id].toggle >> >> I hear you cry, and yes it works, but what I am trying to do is the >> equivalent of: >> >> Effect.toggle(''div_id'', ''blind'') >> >> Can anybody tell me have to write this in a rjs template?? >> >> Any help great fully received. >> >> David. >> >> >>> >> > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---