Forum: Ruby on Rails open flash chart and ajax

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.
Sijo k. (Guest)
on 2009-04-21 11:07
Hi
    I want to refresh a graph For that what should I do.The following is
an example from the site
My controller code like

def dashboard
    @graph =
open_flash_chart_object(600,300,"#{request_summary_graph_path}", true)
end

  def draw_summary_graph
  g = Graph.new
  g.title( 'Users vs. Ram - 24h statistics', '{color: #7E97A6;
font-size: 20; }' )
g.set_data([289,198,143,126,98,96,124,164,213,238,256,263,265,294,291,289])
etc etc.........
  render :text => g.render

  end

and my view (dashboard.html.erb ) like

<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
   <td>
     <%= link_to_remote 'Refresh', {:url => request_summary_graph_path},
                :update => "test_div_this" %>
   </td>
</tr>
<tr>
   <td >
     <div id="test_div">
       <%= @graph %>
     </div>
   </td>
</tr>
</table>


         What i am trying to do when clicking on Refresh link the
portion inside div "test_div"
refreshed But this does not happen Please help

Thanks in advance
Sijo
This topic is locked and can not be replied to.