For the beans, soak overnight, change the water and boil until soft. Drain and set aside.
In a saucepan, over medium heat, put the butter to melt. Add the onion, garlic, chili flakes, and a pinch of salt. Sauté for about 7-8 minutes. Add the tomatoes, stirring with a wooden spoon. Add the teaspoon of sugar, reduce the heat to low and cook, uncovered, at the barest simmer, stirring occasionally.
Add the cooked beans and another pinch of salt. Stir in the parsley about 5 minutes before serving.