+ def lessinfo_candidate
+ @show_details = false
+ @candidate = Candidate.find( params[:id] )
+ render :partial => 'candidate_line'
+ end
+
+ def moreinfo_candidate
+ @show_details = true
+ @candidate = Candidate.find( params[:id] )
+ render :partial => 'candidate_line'
+ end
+
+ def edit_candidate
+ @candidate = Candidate.find( params[:id] )
+ @election = @candidate.election
+ end
+
+ def update_candidate
+ @candidate = Candidate.find(params[:id])
+ @election = @candidate.election
+
+ if @candidate.update_attributes(params[:candidate])
+ redirect_to :action => 'edit_candidates', :id => @candidate.election.id
+ else
+ render :action => 'edit_candidate'
+ end
+ end
+
+ def candidate_picture
+ candidate = Candidate.find( params[:id] )
+ send_data( candidate.picture_data,
+ :filename => candidate.picture_filename,
+ :type => candidate.picture_type,
+ :disposition => 'inline' )