Wash, trim, peel the eggplants and cut into cubes. Put them in a colander, sprinkle with salt, cover with a plate pressed by a weight and let it rest for an hour or so to lose all the water inside them. After about 1 hour, rinse and dry with paper towels. Fry the eggplant in a pan with plenty of olive oil and, when they are golden, drain on paper towels to remove excess oil and salt. Sauté the garlic cloves peeled in hot oil, then add the chopped tomatoes, salt and pepper, stir and cook for about 15 minutes until the sauce has reached the right consistency. Once cooked, remove the garlic and add the eggplant and half of the basil. Meanwhile cook the pasta in plenty of boiling salted water. Drain the pasta and mix with the sauce, garnish with basil leaves and lots of grated ricotta. Serve hot.