Hi everyone, I''m working with rails 2.1.1 and i''m in trouble with the scriptaculous helper. I have something like : <%= link_to_function "Details" do |page| page[''toto''].visual_effect(:toggle_blind) end %> <div id="toto"> Bouh </div> Which generates : <a onclick="try { $("toto").visualEffect("toggle_blind"); } catch (e) { alert(''RJS error:\n\n'' + e.toString()); alert(''$(\"toto\").visualEffect(\"toggle_blind\");''); throw e }; return false;" href="#">Details</a> <div id="toto"> Bouh </div> When i click it under firefox, I get the error : RJS error: TypeError: Effect[klass] is not a constructor I get approximatively the same error on safari. Does anyone see what''s the problem ? Thanks Olivier -- 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 -~----------~----~----~----~------~----~------~--~---
Finally, i made it work but by coding : My old code : link_to_function("Show me more", nil, :id => "more_link") do |page| page[:details].visual_effect :toggle_blind page[:more_link].replace_html "Show me less" end doesnt work. I think the page http://api.rubyonrails.com/classes/ActionView/Helpers/JavaScriptHelper.html#M001687 should be modified because it gives a non working example ! cheers -- Olivier -- 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 -~----------~----~----~----~------~----~------~--~---
Hi, did you include the following line of code in your head tag: <%= javascript_include_tag :defaults %> -Conrad On Sat, Sep 20, 2008 at 1:56 PM, Olivier Sarrouy < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Finally, i made it work but by coding : > > > My old code : > > link_to_function("Show me more", nil, :id => "more_link") do |page| > page[:details].visual_effect :toggle_blind > page[:more_link].replace_html "Show me less" > end > > doesnt work. > > > I think the page > > http://api.rubyonrails.com/classes/ActionView/Helpers/JavaScriptHelper.html#M001687 > should be modified because it gives a non working example ! > > > cheers > > -- > Olivier > -- > 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 -~----------~----~----~----~------~----~------~--~---
dabukun-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Sep-30 23:42 UTC
Re: RJS and :visual_effect
I''m trying to accomplish the same thing with no luck. So did you just code the javascript yourself instead of using the helpers? I second that the documentation seems to be inaccurate... On Sep 20, 4:56 pm, Olivier Sarrouy <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Finally, i made it work but by coding : > > My old code : > > link_to_function("Show me more", nil, :id => "more_link") do |page| > page[:details].visual_effect :toggle_blind > page[:more_link].replace_html "Show me less" > end > > doesnt work. > > I think the pagehttp://api.rubyonrails.com/classes/ActionView/Helpers/JavaScriptHelpe... > should be modified because it gives a non working example ! > > cheers > > -- > Olivier > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
This syntax worked for me: <%= link_to_function "Details" do |page| page.visual_effect(:toggle_blind, ''toto'') end %> <div id="toto"> Bouh </div> - Greg --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---