app/controllers/credit_controller.rb
# Deletes one or more finalized credits from the worksheet
Deletes one or more finalized credits from the worksheet
Deletes one or more finalized credits from the worksheet
def admin_destroy
    return redir_error(TinyException::SECURITYHACK, @user) unless @user.admin?
    if params[:c]
      @credit_assignments = @student.credit_assignments.find(:all, :conditions => "id in (#{params[:c]})")
      @credit_assignments.each do |ca|
        ca.destroy
      end
    end
    @credit_assignments = @student.unfinalized_credits
    flash[:notice] = "The credits were deleted."
    redirect_to credit_assignments_path(@student) 
  end
def admin_destroy return redir_error ( TinyException :: SECURITYHACK , @user ) unless @user . admin? if params [ :c ] @credit_assignments = @student . credit_assignments . find ( :all , :conditions => "id in (#{params[:c]})" ) @credit_assignments . each do | ca | ca . destroy end end @credit_assignments = @student . unfinalized_credits flash [ :notice ] = "The credits were deleted." redirect_to credit_assignments_path ( @student ) end
Deletes one or more finalized credits from the worksheet
Deletes one or more finalized credits from the worksheet