Matthias Sch.
2008-Nov-29 16:41 UTC
[Help] Rendering a partial with link_to function&effects
Hello, I''m trying to render a partial with link_to_function. In a partial called "_search" I''m calling the method "searching" from search_helper.rb as follows : <div id="search"><%searching%></div> The method searching looks like this : def searching tags = @tags.strip tags_array = tags.split('' '') search_tags = tags_array.collect do |tag| %(<span class="tag">#{tag}</span><a href="#{link}">X</a>) end end As you see the following link is created for each element in tags: tag1X tag2X tagX ...(X is a link) Now I want to render a partial, which BlindsUp und Down with the visual_effects helper BlindUp,BlindDown when clicking on a link next to the link "X". I tried : def myhelper page.replace ("nav", :partial=>''searchnavi'') end def searching tags = @tags.strip tags_array = tags.split('' '') search_tags = tags_array.collect do |tag| %(<span class="tag">#{tag}</span><a href="#{link}">X</a>{link_to_function "V" do |page| page.myhelper end}<div id="nav"></div>) end end Is this the right way to do this? Perhaps somebody could give me a hint how I could first render a partial an then BlindUp and BlindDown it smoothly over the <div id="search><% search %> </div> and not in it (like a DrowDown menĂ¼). Thanks for your help and ecxuse my bad english :) -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---