Sha256: 4235b1091b3c9d8d77830ac17faa03401e79df941602ddbe66d90625fb1ac90e
Contents?: true
Size: 979 Bytes
Versions: 29
Compression:
Stored size: 979 Bytes
Contents
class PartiesController < ApplicationController skip_before_filter :populate_layout, :only => [:burn_down_chart, :burn_down_chart_thumbnail, :burn_down_chart_large] skip_before_filter :authenticate_user, :only => [:burn_down_chart, :burn_down_chart_thumbnail, :burn_down_chart_large] def burn_down_chart send_burn_down_chart Chart::NORMAL end def burn_down_chart_thumbnail send_burn_down_chart Chart::THUMBNAIL end def burn_down_chart_large send_burn_down_chart Chart::LARGE end private def send_burn_down_chart(size) party = Party.find(params[:id]) if period = party.periods.select{|p| p.active?}.first || party.periods.last g = period.burn_down_graph(size) send_data(g, :disposition => 'inline', :type => 'image/png', :filename => "burn_down_chart.png") else populate_layout render :file => "public/404.html", :layout => true, :status => 404 end end end
Version data entries
29 entries across 29 versions & 1 rubygems