How to hide a toggling page element by default

I have a link in an rhtml template:

<%= link_to_remote "Edit", :url => {:action => :toggle_edit_campaign}
%>

that executes an action to toggle a page element (edit_campaign):

def toggle_edit_campaign
    render :update do |page|
      page.toggle :edit_campaign
    end
  end

Toggling works, but the edit_campaign element is visible by default
when the page loads. I would like it to be hidden by default, and
then toggle show, hide, show, hide, etc. when the above link_to_remote
is clicked. How does one do this (make the element hidden by default,
and toggle to visible on the first click)?

Thanks.

Set style=‘display:none’ on the element as an attribute.

Hi,

If :edit_campaign is a div you do:
<div style='display:none;'>content</div>

Cheers

Worked like a charm. For anyone trying to hide a toggling div, that's
the solution. Thanks very much.

Here's how the div looks:

<div id="edit_campaign" style="border: solid 1px #999; background-
color:#fff; padding:4px;display:none;">