Forum: Ruby on Rails [Help] Rendering a partial with link_to function&effects

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A2a31c6a16e6014feecffbfbe0ae62a1?d=identicon&s=25 Matthias Sch. (mathao)
on 2008-11-29 17:41
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 :)
This topic is locked and can not be replied to.