Hi:
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
view:
<div id="hide-subs">
<%= link_to_function("Hide Subgoals", nil, :id => "more_link") do
|page|
page[:hide-subs].replace_html "<%= link_to_function(“Hide
Subgoals”)
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!
Mike