rendered paste bodyrails view:
<div id="graph">
</div>
<div id="graph_type">
<%= link_to_remote 'weekly', :update => 'graph', :url =>{:controller => 'graph', :action => 'test_html', :text => 'weekly'} %>
</div>
graph controller:
def test
text = params[:text] || 'test'
g = Gruff::Line.new(400)
g.title = text
data = [0,2,2,nil,nil]
g.data(text,data)
send_data(g.to_blob,
:disposition => 'inline',
:type => 'image/jpg',
:filename => 'test.jpg')
end
def test_html
render :text => "<img src=\"#{url_for :controller => 'graph', :action => 'test', :text => params[:text]}\""
end