title: Remembering the state of the tree view menu on refreshing the page in ruby
body: <p>I have a tree view menu in ruby. 
  I am expanding the tree and it works well.
  On refreshing the page it collapsesand my expansion is not seen.
  Please let me know if there is a way to rember the state of the tree view.</p>
  
  <p>my view code:</p>
  
  <pre><code>%table.treeTable
  %thead
  %th
    All:
    = link_to "Expand", "#", :class =&gt; "all_action_expand"
    = "/"
    = link_to "Collapse", "#", :class =&gt; "all_action_collapse"
  %th
    = link_to "Check", "#", :class =&gt; "check_all"
    = "/"
    = link_to "Uncheck", "#", :class =&gt; "uncheck_all"
  
  
  %tbody 
  - Ic.make_tree(@ics).values.each do |root|
    %tr{:id =&gt; root.tree_id, :class =&gt; "root"}
      %td= root.root_name
      - if show_check_boxes
        %td= check_box_tag "ic_glob", root.tree_id, false, :class =&gt; "ic_parent"
    - root.suites.each do |suite|
      %tr{:id =&gt; suite.tree_id, :class =&gt; "child-of-#{root.tree_id}"}
        %td= suite.suite_name
        - if show_check_boxes
          %td= check_box_tag "ic_glob", suite.tree_id, false, :class =&gt; "ic_parent"
      - suite.children.each do |case_item|
        %tr{:id =&gt; case_item.tree_id, :class =&gt; "child-of-#{suite.tree_id}"}
          %td= case_item.case_name
          - if show_check_boxes
            %td= check_box_tag "ic_glob", case_item.tree_id, false, :class =&gt; "ic_parent"
        - case_item.children.each do |ic|
          %tr{:id =&gt; ic.id, :class =&gt; "child-of-#{case_item.tree_id}"}
            %td= link_to ic.name, edit_ic_path(ic.id)
            - if show_check_boxes
              %td= check_box_tag "ic_ids[]", ic.id, false
    /Execute the tree table javascript (hackish)
    = javascript_tag "$('.treeTable').treeTable({persist:true})"
    / Need some Ic javascript to (cascading selects, etc.)
    = javascript_include_tag "pages/ic"
    = javascript_include_tag "jquery.cookie"
  </code></pre>