Cook pasta according to package directions.
Place spinach in a colander. Once pasta is done cooking, reserve 1/2 cup of the cooking water then pour the remaining water and pasta over the spinach in the colander to drain. Set aside.
Add oil to the pot the pasta was cooked in and heat over medium-high heat.
Add minced garlic and red pepper flakes to the hot oil; cook for 30 seconds or until fragrant, stirring frequently.
Pour pasta mixture back into the pot, then stir in ricotta, salt, and pepper.
Stir in reserved pasta water a little a time until the desired consistency is reached.
Serve warm with chopped pineapple on the side.