Forum: Ruby on Rails Show/hide - noob perplexed

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
39025a7f572d6fe464e1fe6be399ca3b?d=identicon&s=25 Mike Dershowitz (mdersh53)
on 2007-02-23 19:53

I want to do something that's pretty simple I think, or at least it was
in pure javascript, but i'm getting tripped up in rails.  I have a Hide
link that should hide a certain div when clicked.  When clicked, I want
that link to be replaced with a "show" link, and when that link is
clicked, I want the stuff that was hidden to be shown.  I need some
direction or suggestions here, becuase I'm using the following in my

    <div id="hide-subs">
      <%= link_to_function("Hide Subgoals", nil, :id => "more_link") do
      page[:hide-subs].replace_html "<%= link_to_function("Hide

do |page| end %>"
    end %>

And getting a compile error.  So that's not working.  But then I
couldn't find a page method that simply hid a div that wasn't a
scriptaculous effect.  If I had that, I could add another page[:div]
call before or after my replace_html call.  And then my only problem
would be how to inject merely a link as the "replace_html".  So
basically I'm looking for some direction, as I'm unfamiliar with how
this structure would work.

Thanks so much in advance for your help!

0564099250fb8b68fcce19f2ebe6afac?d=identicon&s=25 Juan Roberto Morales (Guest)
on 2007-02-24 10:32
(Received via mailing list)
if your code is exactly as typed...

check your tags, you have an additional end %>

hope this helps.

On 2/23/07, Mike Dershowitz <> wrote:
> view:
> Mike
> --
> Posted via
> >

Juan Roberto Morales
Gerente General
Digital Vision Studios
This topic is locked and can not be replied to.