Skip to content

Instantly share code, notes, and snippets.

@deadprogram
Created January 12, 2010 18:06
Show Gist options
  • Save deadprogram/275414 to your computer and use it in GitHub Desktop.
Save deadprogram/275414 to your computer and use it in GitHub Desktop.
# GET /user/1/time_spent
def time_spent
@time_spent = @user.time_spent
respond_to do |format|
format.xml { render :xml => @time_spent.to_xml }
format.json { render :json => @time_spent.to_json }
format.png { send_data(Spark.plot( @time_spent, :has_min => true, :has_max => true, 'has_last' => 'true', 'height' => '30', :step => 10 ), :type => 'image/png',
:filename => "#{@user.login}_time_spent.png",
:disposition => 'inline') }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment